Skip to content

[backport cloud/1.56] FE-3257 fix(billing-web): a late sign-in no longer sends an open checkout to the home page - #20326

Merged
comfy-pr-bot merged 1 commit into
cloud/1.56from
backport-20319-to-cloud-1.56
Oct 6, 2026
Merged

comfy-pr-bot merged 1 commit into
cloud/1.56from
backport-20319-to-cloud-1.56

Conversation

@comfy-pr-bot

Copy link
Copy Markdown
Member

Backport of #20319 to cloud/1.56

Automatically created by backport workflow.

…kout to the home page (#20319)

## 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-subscribe` canceled
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…`. `SignInView` reads
`route.query.returnTo` only when `onSignedIn` fires. With the shared web
session, `App.vue` remounts the router view under `BillingShell` once
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/checkout` correctly. When the second one resolves
later, the current route is the checkout, which has no `returnTo`.
`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/current` round trip,
which is why it's intermittent.

## How
`onSignedIn` navigates 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
| AS IS (testbilling, QA report) | TO BE (this branch, local billing-web
against testcloud) |
| --- | --- |
| <img width="480"
src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-20319/as-is.png">
| <img width="400"
src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-20319/to-be.jpg">
|
| The subscribe link lands on the billing home page at `/` | The same
link goes through `/sign-in` and stays on `/v1/checkout` |

## Test plan
- [x] SignInView: a sign-in returns to the `returnTo` link; a sign-in
resolving after the route moved to the entry does not call
`router.replace` (red before the fix)
- [x] vitest `apps/billing-web/src/views` + `src/auth`: 391 passed
- [x] Local billing-web against testcloud: opened the checkout link
fresh twice, and both went through `/sign-in` and landed on
`/v1/checkout`
- [ ] Verify on testbilling after deploy

- Fixes FE-3257
- QA thread:
https://comfy-organization.slack.com/archives/C0932CGKT5K/p1791299972813079

---------

Co-authored-by: GitHub Action <action@github.com>
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Oct 6, 2026
@comfy-pr-bot
comfy-pr-bot requested review from a team and dante01yoon as code owners October 6, 2026 17:27
@comfy-pr-bot
comfy-pr-bot enabled auto-merge (squash) October 6, 2026 17:27
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle Size

⏳ Size data collection in progress…

🌾 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 aac88716f4225b5b47530f1b9c457c199c6d987d

Full docs: ADR-DEVEX-LINT-0015

🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure

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.

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

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@              Coverage Diff              @@
##             cloud/1.56   #20326   +/-   ##
=============================================
  Coverage              ?   86.02%           
=============================================
  Files                 ?     2548           
  Lines                 ?   143203           
  Branches              ?    37153           
=============================================
  Hits                  ?   123197           
  Misses                ?    19478           
  Partials              ?      528           
Flag Coverage Δ
billing-web-unit 92.22% <100.00%> (?)

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

Files with missing lines Coverage Δ
apps/billing-web/src/views/SignInView.vue 93.44% <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.

@comfy-pr-bot
comfy-pr-bot merged commit 0229040 into cloud/1.56 Oct 6, 2026
96 of 97 checks passed
@comfy-pr-bot
comfy-pr-bot deleted the backport-20319-to-cloud-1.56 branch October 6, 2026 17:33
@github-actions github-actions Bot added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Oct 6, 2026

@dante01yoon dante01yoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean backport, identical diff to the original.

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:xhigh PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants