fix(browser-transfer): keep the resourceId of a completed or lost-complete upload (01-02)

A failed checkpoint cleanup after a committed complete returned a failure and
dropped the resourceId, and abort() on ALREADY_COMPLETED returned no id. The
upload now succeeds, abort() reads the id from status first, and the port and
design doc state the in-progress complete contract (429 + Retry-After).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DongHyeonka
2026-09-25 22:11:04 +09:00
co-authored by Claude Opus 5.5
parent 5cc1d002d2
commit 7b2cefbd32
4 changed files with 308 additions and 7 deletions
@@ -92,6 +92,12 @@ export type QuarantinedUpload = Readonly<{
export type UploadAbortOutcome = Readonly<{
state: "ABORTED" | "ORPHANED" | "ALREADY_COMPLETED" | "NOT_FOUND";
/**
* 01-02. `ALREADY_COMPLETED` only, when the server status still names the
* quarantined resource the session completed (a complete whose response was
* lost). Absent when the server no longer knows the session.
*/
resourceId?: string;
}>;
export interface ResumableUploadPort {
@@ -194,6 +200,15 @@ export interface ResumableUploadControlPlane<Capability> {
signal: AbortSignal;
}>): Promise<UploadProviderResult<UploadPartCapability<Capability>>>;
/**
* 01-02. In-progress contract. While a complete with the same idempotency
* key is still running, the server answers `429` with a `Retry-After` within
* the client's `maxRetryAfterMs`, which the client retries with the same key
* (`503` is retried too, without reading `Retry-After`). It never answers
* `409`: the client reads that as a final `CONFLICT`. Until the resource is
* committed `getStatus` stays `ACTIVE` with every part accepted; there is no
* "completing" status value.
*/
complete(input: Readonly<{
protocol: ResumableUploadProtocol;
sessionId: string;