Repository navigation
feat(preprod): Poll snapshot ZIP build status before downloading - #116827
NicoHinderling wants to merge 2 commits into
Conversation
4c5baa4 to
a4402be
Compare
0801156 to
c0153d5
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
a4402be to
37594af
Compare
37594af to
e1d921b
Compare
c8d9154 to
6d6c297
Compare
e1d921b to
611a7c8
Compare
611a7c8 to
e26604c
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e26604cd89390725c094e0e5e858af0f7bf29f79. Configure here.
The Download Images action now polls the new /archive/ status endpoint and downloads the prepared ZIP via ?download=true once the build is ready, registering the new route URL in the getApiUrl known-URLs typing. Previously the "Preparing…" toast auto-dismissed after ~6s while the build kept running in the background, leaving the user with no feedback. Read the "progress" field from the archive status poll and re-issue the loading toast on every 3s tick so it stays visible and shows the live build percentage, with copy letting the user know they can leave and download again later. Co-Authored-By: Claude <[email protected]>
e26604c to
8664f63
Compare
A second "Download Images" click reused the cached {status: "ready"} from
the status query (staleTime: 0 serves stale cache synchronously) and fired
the download immediately, skipping the prepare/poll flow. If the archive
was no longer ready server-side, the download would 409 without re-preparing.
Clear the cached status when a new prepare starts so the effect waits for a
fresh ready response before downloading.
Co-Authored-By: Claude <[email protected]>
| if (!isPreparingDownload || !downloadStatus) { | ||
| return; | ||
| } | ||
| if (downloadStatus.status === 'ready') { |
There was a problem hiding this comment.
Out of curiosity, would it be equivalent to use a switch for this sort of thing, or is there a meaningful difference b/w them (or reason to favor one vs another)?
There was a problem hiding this comment.
could definitely do a switch, this is still a WIP PR and not even sure if we'll end up shipping this polling logic yet though. still testing on large uploads


Points the "Download Images" action at the new async, resumable snapshot-archive endpoint (
.../snapshots/<id>/archive/) added in #116825.That endpoint no longer streams the ZIP synchronously. Instead, a plain
GET .../archive/returns{status}and enqueues a background build, andGET .../archive/?download=trueserves the finished, resumable file. So clicking "Download Images" now:building(viauseApiQuery+refetchInterval, matching the existing preprod polling pattern insnapshots.tsx).ready, downloads the file viadownloadFromHref(..., '.../archive/?download=true').Depends on the backend PR (#116825) being deployed first (the
/archive/endpoint must exist). The old/download/endpoint is untouched, so there is no deploy-ordering risk: this PR can merge whenever, and the old endpoint is removed in a later cleanup once nothing references it. Behind the existingorganizations:preprod-snapshotsflag.