Skip to content

[PB-6899]: settle every queued file so folder uploads never hang - #2199

Open
terrerox wants to merge 5 commits into
masterfrom
fix/folder-upload-stuck-processing
Open

terrerox wants to merge 5 commits into
masterfrom
fix/folder-upload-stuck-processing

Conversation

@terrerox

@terrerox terrerox commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Uploading a folder with many files could stay stuck at "Processing" / 100% forever with files missing (e.g. 998/1000), usually after a 502 on POST /drive/files in the console.

Root cause: the UploadManager queue worker ran an un-awaited async upload(). Any throw or rejection before or inside the uploadFile chain (e.g. IndexedDB getUploadState on the retry after a 502, or an undefined rejection value) escaped, next was never called and the folder's Promise.all never settled. A throwing success listener could also re-upload the file and call next twice.

Changes:

  • Uploads run as a single awaited chain: processFile → uploadWithRetries → uploadAttempt, with a top-level .catch and a callOnce guard so next is always called exactly once.
  • The retry is awaited and error classification no longer throws on unexpected rejection values.
  • Success listeners are isolated (runListener); floating setUploadState / removeUploadState promises now have a .catch.

Behaviour change: a throwing success listener is now reported and the file is kept as uploaded (previously it was re-uploaded and then marked as failed).

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

The queue worker ran an un-awaited async upload, so any throw or rejection before or inside the upload chain escaped, next was never called and the folder upload stayed at Processing forever. Uploads now run as a single awaited chain with a guarded callback, awaited retries, safe error classification and isolated success listeners.
@terrerox
terrerox requested a review from a team as a code owner October 3, 2026 21:54
@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 69db71f
Status: ✅  Deploy successful!
Preview URL: https://98681b3c.drive-web.pages.dev
Branch Preview URL: https://fix-folder-upload-stuck-proc.drive-web.pages.dev

View logs

@terrerox terrerox changed the title [_]: settle every queued file so folder uploads never hang [PB-6899]: settle every queued file so folder uploads never hang Oct 3, 2026
@terrerox terrerox self-assigned this Oct 3, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

1 participant