Repository navigation
FE-3257 fix(billing-web): a late sign-in no longer sends an open checkout to the home page - #20319
Conversation
🌾 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 ed459b7cac5d170f749da06a8e3015bcea41c54f
Full docs: ADR-DEVEX-LINT-0015 🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measureExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight This candidate changes nothing the matrix measures, so every expensive stage was 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe sign-in completion callback now skips return navigation when the current route is not named ChangesSign-in return navigation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change preserves the requested destination after sign-in while preventing a late completion from redirecting users away from checkout. No actionable merge-blocking risk is evident. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The change prevents late sign-in completion from redirecting a tab that has already left sign-in. It preserves destination validation and authentication behavior, with no material security risk identified in the changed flow. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
Full details: End-To-End Regression Coverage For FixesExplanation The PR title and commit subject include the bug-fix signal “fix.” The listed changes are under
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🔧 Auto-fixes AppliedThis PR has been automatically updated to fix linting and formatting issues.
Changes made:
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #20319 +/- ##
==========================================
+ Coverage 85.46% 86.38% +0.92%
==========================================
Files 3523 2581 -942
Lines 169083 144235 -24848
Branches 46302 39415 -6887
==========================================
- Hits 144505 124603 -19902
+ Misses 22593 19100 -3493
+ Partials 1985 532 -1453
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 943 files with indirect coverage changes 🚀 New features to boost your workflow:
|
christian-byrne
left a comment
There was a problem hiding this comment.
Reviewed the exact current head, changed files, regression coverage, settled required checks, and existing review threads. The implementation is sound and ready for the author to queue.
|
@dante01yoon Successfully backported to #20324 |
|
@dante01yoon Successfully backported to #20326 |
|
|
…still resolving (Comfy-Org#21146) ## Summary Every cold load of billing-web's `/sign-in` briefly showed "Sign-in is unavailable right now." before the sign-in providers appeared. The notice now renders only after the identity configuration has actually failed to resolve. **Why:** Hunter hit the flash on production while re-testing IR-146 (billing-web upgrade flow, build `24f1250`). It reads as a failure on a healthy page and is the same copy an incident would show, so it misleads users and would make a notice-based monitor fire on every visit. **Root cause:** `useSignInController` exposed `available = identity !== undefined`. `identity` is `undefined` both while `/api/features` is still being fetched and after the fetch has failed, so `SignInView` showed the unavailable notice (and its retry) for the whole resolution window. **How:** the controller now reports `identityStatus: 'resolving' | 'ready' | 'unavailable'`. - `unavailable`: the notice and "Try again" render. - `resolving`: no notice, provider buttons stay disabled. - `ready`: unchanged. The existing 4s config-fetch timeout still ends a hung request in `unavailable`, so a dead config endpoint still surfaces the notice. The two `billingWebAuth.flagOff` tests that asserted the notice during the undecided first render now assert the opposite; their routing intent (reach `/sign-in` without waiting for the flag) is unchanged. ## Verification - Tests: `pnpm exec vitest run --root apps/billing-web` passes (1516 tests). New controller test: `resolving` until the identity resolution settles, then `unavailable`. New view test: no alert and no retry while resolving, with providers disabled. `pnpm typecheck:billing-web` passes. - Human QA: signed-out cold load of `/v1/checkout?product=comfyui&return_to=comfyui_workspace&plan=standard-annual` in a fresh headless Chromium context, with only `GET /api/features` held back 3s (network delay, the real backend still answers). AS IS = production billing.comfy.org (`24f1250`, cloud.comfy.org); TO BE = this PR's Vercel preview (testcloud.comfy.org). Screenshots at ~1s (config in flight) and after the providers enable. | AS IS (prod `24f1250`) | TO BE (this branch) | |---|---| | **Resolving** (~1s, `/api/features` in flight)<br><img width="480" alt="as-is-resolving" src="https://github.com/user-attachments/assets/25b0815c-be63-4abc-91d8-981deacabff6" /><br>"Sign-in is unavailable right now." + "Try again" | <img width="480" alt="to-be-resolving" src="https://github.com/user-attachments/assets/916af223-99dc-42d5-81b2-625d08f5f6e6" /><br>No alert, providers disabled | | **Settled** (config resolved)<br><img width="480" alt="as-is-settled" src="https://github.com/user-attachments/assets/2ce46f0d-3419-4a40-b599-325b703385fe" /> | <img width="480" alt="to-be-settled" src="https://github.com/user-attachments/assets/6f81666f-4554-4032-b34d-b76980b38813" /> | ## Plan position (IR-146 follow-ups) | Item | Owner | PR | Status | |---|---|---|---| | Roll back `hosted_billing_destination` to stripe 100% | FE | — | Done | | Production deploy of billing-web `24f1250` (Comfy-Org#20319, Comfy-Org#20532) | FE | — | Done | | **B1: no "unavailable" flash while sign-in resolves** | FE | **this PR** | **In review** | | B2: card form on billing-web checkout (`embedded_checked_enabled`) | FE + Hunter | — | Testing | | B3: revert a scheduled change from the UI | Product | — | Needs ticket | | A1: production drift alert for billing-web | FE | — | Planned | ```mermaid graph LR R["Flag rollback"] --> D["Prod deploy 24f1250"] D --> B1["B1: sign-in flash fix (this PR)"] D --> B2["B2: embedded checkout decision"] B1 --> RR["Re-ramp billing_web"] B2 --> RR A1["A1: prod drift alert"] --> RR style B1 fill:#f9d71c,stroke:Comfy-Org#333,stroke-width:2px ```
Why
In QA, opening testbilling from the app's subscribe sometimes landed on the billing home page ("Open billing from your Comfy product to manage your plan…") instead of the checkout, with
preview-subscribecanceled in DevTools. Denys reproduced it often by opening checkout, closing the tab, and subscribing again.Root cause
A fresh billing-web tab always goes through
/sign-in?returnTo=/v1/checkout….SignInViewreadsroute.query.returnToonly whenonSignedInfires. With the shared web session,App.vueremounts the router view underBillingShellonce the workspace scope arrives, so a second sign-in page mounts and starts its own mint for the already-restored user. The first page's mint navigates to/v1/checkoutcorrectly. When the second one resolves later, the current route is the checkout, which has noreturnTo.safeReturnTo(undefined)then falls back to/, and the router replaces the checkout with the home page mid-preview. The timing depends on the shell remount and the second/workspaces/currentround trip, which is why it's intermittent.How
onSignedInnavigates only while the tab is still on the sign-in route. A sign-in that resolves after the tab has moved on does nothing.AS IS / TO BE
//sign-inand stays on/v1/checkoutTest plan
SignInView: a sign-in returns to the
returnTolink; a sign-in resolving after the route moved to the entry does not callrouter.replace(red before the fix)vitest
apps/billing-web/src/views+src/auth: 391 passedLocal billing-web against testcloud: opened the checkout link fresh twice, and both went through
/sign-inand landed on/v1/checkoutVerify on testbilling after deploy
Fixes FE-3257
QA thread: https://comfy-organization.slack.com/archives/C0932CGKT5K/p1791299972813079