Repository navigation
fix(billing-web): end the handoff tab when Cloud refuses the whole session - #23373
Conversation
…BLED A scoped-session call refused with 403 HANDOFF_DISABLED left the tab signed in until the session expired, so turning local_billing_web off kept the billing UI up for up to 30 minutes with every call failing.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure
Findings and check detailsExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight The matrix runs on same-repository version-bump PRs with relevant changes, main-branch pushes, and manual dispatches. This candidate does not qualify, so every expensive stage was skipped. Full docs: scripts/registry-census/README.md 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
🌾 Fallow: ✅ PassedFindings and check detailsFallow 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. Full docs: ADR-DEVEX-LINT-0015 Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since f1974bcc949712332d13366ac11d0b8a035f6f51
🏛️ Architecture: ✅ PassedFindings and check detailsWarnings (515)
Full docs: Frontend domain catalog Reproduce locallypnpm architecture:check |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #23373 +/- ##
==========================================
- Coverage 88.00% 88.00% -0.01%
==========================================
Files 3168 3169 +1
Lines 169710 169608 -102
Branches 43764 45767 +2003
==========================================
- Hits 149358 149260 -98
+ Misses 19379 19374 -5
- Partials 973 974 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 40 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…ch the ended screen without an error
…r its end screen When a handoff session ended mid-session the scope went away before the router replaced to /handoff, so App rendered the current billing view outside BillingShell: it threw No billing client, and on the Vite dev server the page stayed blank.
…hole session Cloud's scoped-session policy also answers sso_required, account_outside_organization, personal_workspace_disabled and workspace_access_denied on every call once they apply. BILLING_FORBIDDEN stays: Cloud answers it for one request naming another workspace too.
Swarmhost agentic reviewThe detailed evaluation is available to employees in the internal Slack review thread. Evaluation budget remaining for this pull request: 97 automatic and 99 manual. Updated by Swarmhost's agentic review process. |
comfy-greenlight-bot
left a comment
There was a problem hiding this comment.
This pull request at head commit 9177bae has been reviewed and approved by Swarmhost's agentic review process.
The detailed evaluation is available to employees in the internal Slack review thread.
…f session PR 23395 removed the undesigned "This checkout session has ended" screen. A refused handoff session that sent no payment now ends on "This checkout link no longer works". Both cases here refuse the status read after a cancellation, so both end there.
comfy-greenlight-bot
left a comment
There was a problem hiding this comment.
This pull request at head commit 463cf0e has been reviewed and approved by Swarmhost's agentic review process.
The detailed evaluation is available to employees in the internal Slack review thread.
huang47
left a comment
There was a problem hiding this comment.
Verified the billing handoff redirect. Before-and-after evidence.


Dependency graph
Independent of #23327; both should land before the flag is exposed.
Summary
Why.
local_billing_webis the one switch for the billing handoff. Turning it off must take a user out of billing-web, including a tab that already exchanged its handoff.Root cause. Cloud rechecks the flag on every scoped-session call and answers
403 HANDOFF_DISABLEDonce it is off. billing-web's handoff client only treated401 INVALID_CREDENTIALas the end of the session, so the tab stayed signed in until the session expired (up to 30 minutes from the exchange) while every billing call failed. Cloud still refused the calls; only the screen was wrong.How.
createHandoffBillingClientends the handoff on every 403 Cloud's scoped-session policy answers for the whole session:HANDOFF_DISABLED,sso_required,account_outside_organization,personal_workspace_disabledandworkspace_access_denied, as it already does on401 INVALID_CREDENTIAL.BILLING_FORBIDDENkeeps the tab. Cloud answers it both when the owner lost the workspace (whole session) and when one request names another workspace, and the body does not tell them apart. Ending on it needs Cloud to separate the two.App.vuerenders nothing while an ended handoff tab is replaced to/handoff. Before, the scope went away first and the current billing view remounted outsideBillingShell, which threwNo billing client(and left the Vite dev server on a blank page). This affected the existing 401 path too.AS IS. Flag turned off mid-session: the tab keeps showing billing with failed reads.
TO BE. The tab ends on the next billing call. A tab that sent no payment lands on "This checkout link no longer works"; #23395 (merged) picks the ending screen from what the tab knows about a payment.
Screenshots: real billing-web production build (
vite build+vite preview), Cloud mocked with Playwright routes. The handoff exchange and the first billing reads succeed, then every billing call answers403 HANDOFF_DISABLEDand "Cancel subscription" is clicked, which re-reads/billing/status. AS IS is the same build withbillingWebClient.tsfrom the commit before the fix. TO BE was recaptured at 463cf0e, aftermainwith #23395 was merged in.Found in a cross-review of the handoff (Astra read, confirmed against the code).
Verification
billingWebClient.test.ts): one case per ending 403 code, failing before the fix;BILLING_FORBIDDENkeeps the tab.e2e/handoff-session-ended.spec.ts, production build): a session refused mid-session with 403HANDOFF_DISABLEDor 401INVALID_CREDENTIALreaches "This checkout link no longer works" on/handoffwith no page or console error. Failed on the console error before theApp.vuechange.apps/billing-web: unit session and handoff suites 134 passed; E2E 159 passed before the last commit, handoff specs rerun after it.main(e008428, brings FRONT-3855 fix(billing-web): end every handoff session on a designed ending screen #23395): both E2E cases failed on the removed heading "This checkout session has ended" and nothing else; 463cf0e updates the two expectations and the test title. Handoff E2E specs 13 passed, unit session and handoff suites 151 passed. WithbillingWebClient.tsreverted tomain, the 403 case fails again and the 401 case passes.