Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore errors while waiting for stamp #927

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/bee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@
ReferenceType.MANIFEST,
)
} else if (isReadable(data) && options?.tag && !options.size) {
// TODO: Needed until https://github.com/ethersphere/bee/issues/2317 is resolved

Check warning on line 349 in src/bee.ts

View workflow job for this annotation

GitHub Actions / check (16.x)

Unexpected 'todo' comment: 'TODO: Needed until...'
const result = await bzz.uploadFile(
this.getRequestOptionsForCall(requestOptions),
data,
Expand Down Expand Up @@ -724,7 +724,7 @@
await this.makeFeedReader(type, canonicalTopic, canonicalOwner).download()

return true
} catch (e: any) {

Check warning on line 727 in src/bee.ts

View workflow job for this annotation

GitHub Actions / check (16.x)

Unexpected any. Specify a different type
if (e?.response?.status === 404) {
return false
}
Expand Down Expand Up @@ -1810,21 +1810,15 @@
}

private async waitForUsablePostageStamp(id: BatchId, timeout = 240_000): Promise<void> {
const TIME_STEP = 2_000
const TIME_STEP = 3_000
for (let time = 0; time < timeout; time += TIME_STEP) {
try {
const stamp = await this.getPostageBatch(id)

if (stamp.usable) {
return
}
} catch (error: any) {
const message = error?.response?.data?.message || error?.message || ''

if (!message.includes('batch not usable')) {
throw error
}
}
} catch (error: any) {}

Check warning on line 1821 in src/bee.ts

View workflow job for this annotation

GitHub Actions / check (16.x)

Unexpected any. Specify a different type

Check warning on line 1821 in src/bee.ts

View workflow job for this annotation

GitHub Actions / check (16.x)

Empty block statement

await System.sleepMillis(TIME_STEP)
}
Expand Down
Loading