test(supabase): concurrency seeding accepts Storage's duplicate answer

After e2e:shell seeds the same content-addressed drawing, Storage answers HTTP 400 with statusCode 409 (KeyAlreadyExists); any other 400 still fails. Docs: M7 adds no new write path; a TOTP code replays more than once within its span.
This commit is contained in:
bchanot committed 2026-11-02 23:31:49 +01:00
1 parent dcb1a94ee4
commit f5456f330d
4 files changed
+17 -6

No files matched your search

@@ -240,7 +240,10 @@ describe('two working copies of the historical sheet (§14.3)', () => {
const res = await fetch(`${stack.storageUrl}/object/anatomical-sheet-assets/${row[1]}.svg`, {
method: 'POST', headers: { Authorization: `Bearer ${stack.serviceKey}`, 'Content-Type': 'image/svg+xml' }, body: new Uint8Array(bytes),
})
expect([200, 409]).toContain(res.status)
// Storage reports an existing object as HTTP 400 with statusCode "409" in the body.
const body = await res.text()
const duplicate = res.status === 400 && (JSON.parse(body) as { statusCode?: string }).statusCode === '409'
expect(res.status === 200 || res.status === 409 || duplicate, `${res.status} ${body}`).toBe(true)
ok(await rpc('confirm_sheet_asset_upload', { asset_id: row[0] }, stack.serviceKey))
}
// A copy left active by an earlier run is set aside and put back after.