Skip to content

Tech-debt batch 26: upload queue honours cancels during session lookup; releases finished files (#695) - #704

Merged
antosubash merged 2 commits into
mainfrom
tech-debt/b26-upload-queue
Oct 30, 2026
Merged

antosubash merged 2 commits into
mainfrom
tech-debt/b26-upload-queue

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Tech-debt batch 26 (from the 2026-10-28 scan).

Closes #695

What changed

modules/file_storage/file_storage/pages/upload-queue.ts:

  • A cancelled upload stays cancelled. The worker checked for cancellation once, then awaited the resumable-session lookup (findSession / maybePause). A cancel during that await removed the row, but the upload then started with no visible row, the remaining gap from file_storage: cancelling a queued upload still uploads it #588. The queue now re-checks after the lookup, after maybePause records a waiting session, and after start-over's discardSession (found in review).
  • Finished uploads release their File. Completed rows were cleared from the list but their File stayed in the queue's map for the hook's lifetime. Rows that settle as done now drop their file; failed and still-uploading rows keep theirs for retry.

Verification

  • make lint ✓ · make test-js ✓ · make test-py ✓ (6407 passed, 39 skipped)

  • New Vitest regressions in file_storage_upload_queue_lifecycle.test.ts cover:

    • cancel during the lookup, the pause and start-over: no transport starts;
    • the file map is empty after a successful batch, while failed and concurrent files are kept for retry.

    They fail without the fix.

  • Code review: one finding (start-over), fixed.

  • No browser QA: the races are timing-dependent and are covered deterministically by the Vitest regressions above.

https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4

… File objects (#695)

A cancel during the resumable-session lookup removed the row but the
upload then started anyway; the queue now re-checks after each lookup.
Completed rows released their File objects only on dismiss, so every
uploaded file stayed referenced; they are dropped when the row clears.

Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
… cancelled (#695)

Review follow-up: startOver awaited discardSession without re-checking
for a cancel before starting the new upload.

Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4827a5b
Status: ✅  Deploy successful!
Preview URL: https://12f15b76.simple-module-python.pages.dev
Branch Preview URL: https://tech-debt-b26-upload-queue.simple-module-python.pages.dev

View logs

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-30T08:12:40.476523Z 4827a5b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@antosubash
antosubash merged commit d42a729 into main Oct 30, 2026
17 checks passed
@antosubash
antosubash deleted the tech-debt/b26-upload-queue branch October 30, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

file_storage: upload-queue cancel during session lookup still uploads; completed File objects leak

1 participant