Skip to content

Commit 6ceb299

Browse files
author
Travis Vachon
authored
fix: remove debugging console.logs and nodejs_compat flag (#2553)
I added these all while debugging upload issues, should be able to remove them now
1 parent b4ff571 commit 6ceb299

2 files changed

Lines changed: 0 additions & 15 deletions

File tree

packages/api/src/routes/nfts-upload.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export async function nftUpload(event, ctx) {
7878
let car
7979
/** @type {string} */
8080

81-
console.log('IS CAR?', isCar)
8281
if (isCar) {
8382
car = blob
8483
uploadType = 'Car'
@@ -93,7 +92,6 @@ export async function nftUpload(event, ctx) {
9392
uploadType = 'Blob'
9493
structure = 'Complete'
9594
}
96-
console.log('NFT UPLOADING CAR')
9795
upload = await uploadCar({
9896
event,
9997
ctx,
@@ -107,7 +105,6 @@ export async function nftUpload(event, ctx) {
107105
meta: type === 'ucan' ? { ucan } : undefined,
108106
})
109107
}
110-
console.log('UPLOADED IT, SENDING A RESPONSE!')
111108
return new JSONResponse({ ok: true, value: toNFTResponse(upload) })
112109
}
113110

@@ -145,7 +142,6 @@ function w3upFeatureSwitchEnabled(context, event) {
145142
* @param {UploadCarInput} params
146143
*/
147144
export async function uploadCar(params) {
148-
console.log('UPLOAD CAR')
149145
const stat = await carStat(params.car, {
150146
structure: params.structure,
151147
})
@@ -161,7 +157,6 @@ export async function uploadCarWithStat(
161157
{ event, ctx, user, key, car, uploadType = 'Car', mimeType, files, meta },
162158
stat
163159
) {
164-
console.log('UCWS')
165160
const sourceCid = stat.rootCid.toString()
166161
const contentCid = stat.rootCid.toV1().toString()
167162

@@ -177,11 +172,8 @@ export async function uploadCarWithStat(
177172
const backupUrls = []
178173
// @ts-expect-error email is not expected in types
179174
if (ctx.w3up && w3upFeatureSwitchEnabled(ctx, { user })) {
180-
console.log('SWITCH ENABLED')
181175
const { w3up } = ctx
182176

183-
console.log('UPLOADING CAR')
184-
185177
// we perform store/add and upload/add concurrently to save time.
186178
await Promise.all([
187179
w3up.capability.store.add(car),
@@ -191,13 +183,11 @@ export async function uploadCarWithStat(
191183
w3up.capability.upload.add(stat.rootCid, [stat.cid]),
192184
])
193185

194-
console.log('UPLOADED CAR')
195186
// register as gateway links to record the CAR CID - we don't have another
196187
// way to know the location right now.
197188
backupUrls.push(new URL(`https://w3s.link/ipfs/${stat.cid}`))
198189

199190
if (stat.structure === 'Partial') {
200-
console.log('PARTIAL')
201191
checkDagStructureTask = async () => {
202192
// @ts-expect-error - I'm not sure why this started failing TODO debug further
203193
const info = await w3up.capability.upload.get(stat.rootCid)
@@ -242,7 +232,6 @@ export async function uploadCarWithStat(
242232
}
243233
}
244234
}
245-
console.log('UPLOADED')
246235
const xName = event.request.headers.get('x-name')
247236
let name = xName && decodeURIComponent(xName)
248237
if (!name || typeof name !== 'string') {
@@ -258,7 +247,6 @@ export async function uploadCarWithStat(
258247
status: structure === 'Complete' ? 'Pinned' : 'Pinning',
259248
service: 'ElasticIpfs',
260249
})
261-
console.log('CREATING DB UPLOAD')
262250
const upload = await ctx.db.createUpload({
263251
mime_type: mimeType,
264252
type: uploadType,
@@ -276,10 +264,8 @@ export async function uploadCarWithStat(
276264

277265
// no need to ask linkdex if it's Complete or Unknown
278266
if (checkDagStructureTask) {
279-
console.log('CHECK DAG STRUCTURE TASK IS TRU')
280267
event.waitUntil(checkDagStructureTask())
281268
}
282-
console.log('RETURNING')
283269
return upload
284270
}
285271

packages/api/wrangler.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ compatibility_flags = [
1212
"streams_enable_constructors",
1313
"transformstream_enable_standard_constructor",
1414
"url_standard",
15-
"nodejs_compat",
1615
]
1716
no_bundle = true
1817
r2_buckets = [

0 commit comments

Comments
 (0)