fix(browser-transfer): drop the bridge's second copy of each part (Q-6.1-3b)
The multipart-to-presigned bridge copied every part with Uint8Array.from and the presigned executor then snapshotted the same bytes with slice() before any await. The executor's snapshot is the one the public port needs, so the bridge now forwards the part buffer as is. The executor still re-digests its own copy against the part checksum, so a port that mutated the buffer would fail closed rather than upload other bytes. partBufferCopyFactor is left at 4; changing a policy default is a contract migration. Verified: the bridge test now asserts the port receives the part buffer itself (failed before: it got a copy) + all gates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9e2c98272f
commit
1997ce4bbe
@@ -91,7 +91,9 @@ export function createPresignedUploadPartExecutor(
|
||||
byteLength: input.part.byteLength,
|
||||
checksumSha256: input.part.checksumSha256,
|
||||
idempotencyKey: input.idempotencyKey,
|
||||
bytes: Uint8Array.from(input.bytes),
|
||||
// Q-6.1-3b. The presigned port snapshots `bytes` before any await,
|
||||
// so a second copy here only doubled the per-part buffer.
|
||||
bytes: input.bytes,
|
||||
signal: input.signal,
|
||||
});
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user