fix(client): download stems individually instead of server-side zip - #14563
Open
dylanjeffers wants to merge 1 commit into
Open
fix(client): download stems individually instead of server-side zip#14563dylanjeffers wants to merge 1 commit into
dylanjeffers wants to merge 1 commit into
Conversation
"Download All" queued a job with the archiver service, which zipped the stems server-side while the client polled for up to 15 minutes. Jobs routinely sat in `waiting` with no worker, so users watched a spinner that never resolved — the failure Michael hit on Summer Cypher Vol 2. Hand each file to the browser as its own download instead. Chrome gates a burst of programmatic downloads behind a single "Download multiple files?" prompt, so the batch still costs one approval, and there's no job to stall, nothing buffered in the tab, and each file gets the browser's own progress and resume handling. Filenames come from the server: `/v1/tracks/:id/download` redirects to a content node that sets `Content-Disposition: attachment` from the `filename` query param, so the saga now signs the name it already computes into the URL. That means deduping has to happen before the URLs are built rather than at click time. Native has no browser to hand a batch to, so mobile's Download All goes back to fetching and zipping on-device — same saga, no queue. Removes the archiver client entirely: the SDK service, the modal/drawer, the polling hooks, and ARCHIVE_ENDPOINT.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the "downloading stems is stuck on the loading wheel" report in #eng-general, and implements Ray's follow-up ask in that thread: drop bulk download rather than keep stabilizing the archiver.
Problem
"Download All" never downloaded anything client-side. It queued a job with the archiver service, which zipped the stems server-side while the client polled
getStemsArchiveJobStatusonce per second for up to 15 minutes. When no BullMQ worker slot was free the job sat inwaitingforever and the user watched a spinner that never resolved — exactly the{"id":"…","state":"waiting","progress":0}a Discord mod pasted into the thread during Summer Cypher Vol 2.That queue has been patched repeatedly (pedalboard#88, #89). Ray's call was to stop:
Approach
Hand each file to the browser as its own download, the way ChatGPT's "All 4 images in this series" works. Chrome gates a burst of programmatic downloads behind a single "Download multiple files?" prompt, so the batch still costs one approval — and there is no job to stall, nothing buffered in the tab, and each file gets the browser's own progress and resume handling.
The proxy Ray offered to build already exists.
/v1/tracks/:id/downloadredirects to a content node that setsContent-Dispositionfrom thefilenamequery param, verified against production:Because the saved filename now comes from that header rather than from
link.downloadat click time, the download saga signs its computed name into the URL, and deduping moves ahead of URL construction — a duplicate left unresolved would otherwise land asname (1).wav.Changes
TrackDownload.downloadTrackstriggers one anchor click per file instead offetch-ing everything into memory and zipping withclient-zip.parentTrackId. That is what appends the full track to the batch, and it already drops the parent when it isn't downloadable.react-native-zip-archive. Same saga, no queue.ArchiverService,DownloadTrackArchiveModal/Drawer, the polling hooks, the modal slice, andARCHIVE_ENDPOINT.Testing
tsc --noEmitclean for web (0 errors); sdk, common, and mobile clean in-tree.fileUtiltests (coveringdedupFilenames) pass.curlabove confirms theContent-Dispositionbehavior the change depends on.One caveat on local verification: the worktree had no
node_modules, so I symlinked them from another checkout that sits on an older branch. A handful of residual errors in common/mobile all resolved to paths outside the worktree and are artifacts of that setup — CI on a clean install is the real confirmation.Notes for review
🤖 Generated with Claude Code