Web UI: upload resume hardening (smoke-test findings, #21) #47

Merged
Cordy merged 1 commit from feat/upload-hardening into main 2026-07-28 23:55:08 +00:00
Owner

Nikola's #21 smoke-test surfaced two real bugs behind the "restarts after closing the site" + "progress bar bouncing between two percentages" symptoms:

  1. Resume URL discarded on transient failure. The HEAD resume-check treated any failure (including network still being down) as "upload gone" and dropped the localStorage URL → fresh upload from 0%. Now tri-state: 404/410 = genuinely gone (discard), anything else = unreachable (keep the URL; start pessimistically and let the first PATCH's 409 route into the retry path, which re-syncs the true offset via HEAD).
  2. Double-start on reselect. Selecting the same file while a previous attempt was still in its retry loop started a second concurrent upload of the same file — two loops fighting over one progress bar (the bounce) and double-writing the target. New activeUploads set guards per-destination; reselecting mid-upload now says "already uploading — its progress will continue".

Also: retry path now throws cleanly when the server reports the upload expired instead of silently starting over.

node --check verified inline.

Nikola's #21 smoke-test surfaced two real bugs behind the "restarts after closing the site" + "progress bar bouncing between two percentages" symptoms: 1. **Resume URL discarded on transient failure.** The HEAD resume-check treated *any* failure (including network still being down) as "upload gone" and dropped the localStorage URL → fresh upload from 0%. Now tri-state: `404/410` = genuinely gone (discard), anything else = unreachable (keep the URL; start pessimistically and let the first PATCH's 409 route into the retry path, which re-syncs the true offset via HEAD). 2. **Double-start on reselect.** Selecting the same file while a previous attempt was still in its retry loop started a second concurrent upload of the same file — two loops fighting over one progress bar (the bounce) and double-writing the target. New `activeUploads` set guards per-destination; reselecting mid-upload now says "already uploading — its progress will continue". Also: retry path now throws cleanly when the server reports the upload expired instead of silently starting over. `node --check` verified inline.
web: upload hardening — keep resume URL on transient failures, guard double-start
All checks were successful
ci / test-and-build (pull_request) Successful in 19s
ee689a3d3f
Cordy merged commit d855daadf4 into main 2026-07-28 23:55:08 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#47
No description provided.