Skip to content

[backport cloud/1.57] fix(workspace): a failed deployment check never slows the editor for someone who has not picked one - #21824

Closed
comfy-pr-bot wants to merge 1 commit into
cloud/1.57from
backport-21806-to-cloud-1.57
Closed

comfy-pr-bot wants to merge 1 commit into
cloud/1.57from
backport-21806-to-cloud-1.57

Conversation

@comfy-pr-bot

Copy link
Copy Markdown
Member

Backport of #21806 to cloud/1.57

Automatically created by backport workflow.

…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
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ✅ 2283 passed, 0 failed · 1 flaky

📊 Browser Reports
  • chromium: View Report (✅ 2261 / ❌ 0 / ⚠️ 1 / ⏭️ 0)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 19 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 10/23/2026, 07:15:45 PM UTC

Links

🧩 Custom Nodes Ecosystem Matrix: ✅ Passed

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

Stage Result What a failure here means
pin-status success Informational. It never fails the build; it warns when the corpus snapshot is over 30 days old.
corpus success Infrastructure: the pack mirror could not be fetched, validated or cached. Not your diff.
shards success Harness integrity, not pack breakage. A shard only checks that every built spec wrote its row; vitest's own exit code is deliberately ignored because pack code leaks unhandled rejections.
verdicts success The population verdict per renderer. This is the stage that judges packs. Exit 1 is FAIL; exit 2 is withheld — rows were missing, so nothing was measured, which is not the same as your change breaking packs.
detection-proofs success The instrument self-test: the matrix must FAIL on a deliberately poisoned corpus. A failure here means the gate cannot be trusted this run, in either direction.

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: ✅ Passed

Fallow 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

@vqt123

vqt123 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Closing: Cloud builds cloud/1.58 (cloud's frontend-version.json), so this copy is not needed; #21825 carries the fix there.

@vqt123 vqt123 closed this Oct 23, 2026
auto-merge was automatically disabled October 23, 2026 19:20

Pull request was closed

@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Oct 23, 2026
@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

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           
Flag Coverage Δ
unit 85.20% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...latform/workspace/api/deploymentListingTimeouts.ts 100.00% <100.00%> (ø)
...atform/workspace/components/DeploymentSwitcher.vue 100.00% <100.00%> (ø)
...orm/workspace/composables/waitForDeploymentPick.ts 96.77% <100.00%> (ø)
src/platform/workspace/deploymentHint.ts 96.29% <100.00%> (ø)
...c/platform/workspace/stores/deploymentPickStore.ts 97.40% <100.00%> (ø)
src/platform/workspace/workspaceConstants.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Backporting a PR onto a release candidate risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants