fix(browser-transfer): let abort drop an unreadable checkpoint row (Q-6.1-6)

A corrupt row, or one a newer build wrote with an unknown schemaVersion,
failed both upload and abort with CORRUPT_DATA until the whole partition
was deleted. The checkpoint store port gains an optional
removeUnreadable(): in one transaction it deletes the row only if it does
not parse as a checkpoint (a readable row is CONFLICT, an absent row is a
success). Explicit abort calls it on a CORRUPT_DATA read and reports
ORPHANED; the server session is left to expire because the row names no
session. upload() still fails closed on such a row. The port change is
additive (optional method); the architecture doc notes the exception.

Verified: RED tests "removes an unreadable checkpoint row on abort and
reports ORPHANED" (was CORRUPT_DATA) and "removes only an unreadable row
without a revision" (method missing) + all gates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DongHyeonka
2026-09-24 13:32:37 +09:00
co-authored by Claude Opus 5.5
parent e83cda6f7f
commit 879ceda3bb
6 changed files with 171 additions and 1 deletions
@@ -273,6 +273,18 @@ export interface ResumableUploadCheckpointStore {
expectedRevision: number;
signal?: AbortSignal;
}>): Promise<BrowserDataResult<void>>;
/**
* Q-6.1-6. Deletes the row only when it cannot be read as a checkpoint
* (corrupt, or written by a schema this build does not know); a readable row
* is left alone and reported as `CONFLICT`. An absent row is a success.
* Explicit abort uses it so such a row does not block the upload key until
* the whole partition is deleted. Optional: a store without it keeps the
* old behavior.
*/
removeUnreadable?(input: Readonly<{
uploadKey: string;
signal?: AbortSignal;
}>): Promise<BrowserDataResult<void>>;
close(): void;
}