Repository navigation
[backport cloud/1.57] fix(workspace): a failed deployment check never slows the editor for someone who has not picked one - #21824
comfy-pr-bot wants to merge 1 commit into
Conversation
…someone who has not picked one (#21806) **Why** When the Cloud editor's deployments check is failing, every load of a browser that has never picked a deployment held the canvas for about 3.6 s and sent an error report on every load and every window focus. The editor runs that check for every Cloud workspace once the deployments feature is on for everyone, so a backend outage would slow and flood every such browser. Found by reading the boot path: no hint is written on a failure, no hint means a 5 s wait, and failures are retried and reported each time. ## What changes While the editor's deployments check is failing (a server error or no answer), a Cloud browser that has not picked a deployment stops paying for it on every load. **Before:** every editor load in such a browser held the canvas for about 3.6 s while the check retried, and each failure, on each load and each window focus, sent an `error_loading_deployment_listing` report. Window focus asked again every time. **After:** - The first load waits as today. The failure then records "Comfy Cloud, not confirmed" for this workspace in this browser, so the next load starts the canvas on Comfy Cloud at once. If that load's check then answers with a deployment, the editor says so, exactly as it does today when the check answers after the 5 s wait. A successful answer replaces the record with the real one. - The failure is reported once per page. - Window focus still asks again, at most once a minute while it keeps failing. A browser whose last boot was on a deployment, or whose link names one, keeps today's behaviour: it still waits for the answer and still reports. ## Details for reviewers - `deploymentPickStore.ts`: `noteLoadFailure` (in the store) gets every non-refused listing failure. On a transient one (5xx, 408, 429, no response) it records an unconfirmed Comfy Cloud hint (read as `unconfirmed`) only when the hint reads `unknown` and there is no deployment link. It lives under its own key, `Comfy.Workspace.UnconfirmedCloudHint.<workspace>`: the existing `Comfy.Workspace.DeploymentHint.<workspace>` key keeps holding only `cloud` or a deployment id, because older frontends read any other value there as a deployment id and would wait 45 s. A real answer writes the existing key and clears the new one; the existing key wins when both are set. It is kept apart from the confirmed `cloud` hint (written by a listing or a 403/404), which boots without asking at all. - `waitForDeploymentPick.ts`: an `unconfirmed` hint waits 0 ms instead of 5 s, then takes the existing late-deployment path (`onLateDeployment`). A listing that answers in the same tick still wins. It reports the failure once per page; the flag lives in the store, so each page (and each test's Pinia) starts fresh. - "Has not picked one" is read as "the hint is `unknown`": the pick itself is an HttpOnly cookie the page cannot read, and any listing that answered in this browser already wrote a hint. A browser that has a pick cookie but cleared its storage boots on Comfy Cloud during an outage and is told when the listing comes back with its deployment, as after the 5 s cap today. - The once-per-page report covers every listing failure kind, not only 5xx. - `DeploymentSwitcher.vue`: a 60 s floor between focus-started retries (`DEPLOYMENT_LISTING_FOCUS_RETRY_MS`). ## Tests - `deploymentPickStore.test.ts`: a 503 with no hint leaves the `unconfirmed` hint (a 400 leaves `unknown`); a deployment hint or a deployment link is left alone and the failure is still reported; repeated failures report once; a 200 or a 403 after a failure replaces the `unconfirmed` hint; a failure never writes the existing hint key; the existing key wins over the unconfirmed one. - `waitForDeploymentPick.test.ts`: after a failed listing, the next boot does not wait, runs on Comfy Cloud, and calls `onLateDeployment` when the late listing names a deployment (not when it says Comfy Cloud); a listing that answers at once boots on its deployment. These fail on the first commit, where a failure wrote the confirmed `cloud` hint. - `DeploymentSwitcher.test.ts`: ten focuses 5 s apart during a failure start one retry, the next comes 60 s after the first. - The new store and switcher tests fail on main's code and pass with this change. - `pnpm typecheck`, oxlint, eslint and oxfmt on the changed files pass. Screenshots: in the review ask's Slack thread (the switcher's Storybook stories, light and dark, one at phone width; it looks the same as on main). Try it: nothing on screen changes. In a Cloud build, block the deployments listing request in devtools (or let it return 503), load the editor twice: the second load starts at once, and refocusing the window asks again at most once a minute. **Not run:** an editor load against a real failing listing (browser only, unit tests here); Local and Desktop builds (the code is behind `isCloud`, unchanged). Ref BE-22888
🎭 Playwright: ✅ 2283 passed, 0 failed · 1 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook🧩 Custom Nodes Ecosystem Matrix: ✅ PassedExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff. Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md 🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since bc4edf39070bd1a3a2982bedf46c3e8495ed2f01
Full docs: ADR-DEVEX-LINT-0015 |
|
Closing: Cloud builds cloud/1.58 (cloud's frontend-version.json), so this copy is not needed; #21825 carries the fix there. |
Pull request was closed
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## cloud/1.57 #21824 +/- ##
=============================================
Coverage ? 85.20%
=============================================
Files ? 2522
Lines ? 132961
Branches ? 40688
=============================================
Hits ? 113286
Misses ? 19259
Partials ? 416
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Backport of #21806 to
cloud/1.57Automatically created by backport workflow.