Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion packages/synapse-core/src/sp/upload-streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,14 @@ export async function uploadPieceStreaming(
): Promise<uploadPieceStreaming.OutputType> {
// Create upload session (POST /pdp/piece/uploads)
const createResponse = await request.post(new URL('pdp/piece/uploads', options.serviceURL), {
timeout: RETRY_CONSTANTS.MAX_RETRY_TIME,
timeout: 30_000,
signal: options.signal,
retry: {
retries: 2,
methods: ['post'],
minTimeout: 2_000,
shouldRetry: (ctx) => !HttpError.is(ctx.error),
},
Comment thread
TippyFlitsUK marked this conversation as resolved.
})
Comment on lines 49 to 58

if (createResponse.error) {
Expand Down
7 changes: 3 additions & 4 deletions packages/synapse-sdk/src/test/storage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ describe('StorageService', () => {
http.post<Record<string, never>, { pieceCid: string }>(
'https://pdp.example.com/pdp/piece/uploads',
async () => {
return HttpResponse.error()
return HttpResponse.text('Internal Server Error', { status: 500 })
}
)
)
Expand Down Expand Up @@ -1137,9 +1137,8 @@ describe('StorageService', () => {
...Mocks.presets.basic,
}),
Mocks.PING(),
Mocks.pdp.postPieceHandler(testPieceCID, mockUuid, pdpOptions),
http.put('https://pdp.example.com/pdp/piece/upload/:uuid', async () => {
return HttpResponse.error()
http.post('https://pdp.example.com/pdp/piece/uploads', async () => {
return HttpResponse.text('Internal Server Error', { status: 500 })
})
)
Comment on lines 1139 to 1143
const synapse = new Synapse({ client, source: null })
Expand Down
2 changes: 1 addition & 1 deletion packages/synapse-sdk/src/test/synapse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ describe('Synapse', () => {
// Primary SP rejects upload
server.use(
http.post(`${pdpOptions.baseUrl}/pdp/piece/uploads`, async () => {
return HttpResponse.error()
return HttpResponse.text('Internal Server Error', { status: 500 })
})
)
try {
Expand Down