Skip to content

fix(billing-web): re-quote on QUOTE_STALE in the full-page checkout - #19499

Merged
DrJKL merged 3 commits into
mainfrom
drjkl/fix-billing-quote-stale-requote
Sep 30, 2026
Merged

DrJKL merged 3 commits into
mainfrom
drjkl/fix-billing-quote-stale-requote

Conversation

@DrJKL

@DrJKL DrJKL commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes the full-page-promo.spec.ts "a code that lapses before Pay" failure that has been red on main since #19126. The full-page checkout now re-quotes when a subscribe comes back as QUOTE_STALE.

Changes

Review Focus

SUBSCRIPTION_QUOTE_STALE is gone from STALE_QUOTE_SERVER_CODES. Only subscribe emits it, and account-core now maps it for 4xx responses. A 5xx that echoes the code arrives as REQUEST_FAILED, which account-core treats as an upstream failure, not a stale quote. With this change, that 5xx no longer triggers a re-quote.

Red/green: both updated unit tests fail without the payVerdict.ts change and pass with it. pnpm test:e2e:local e2e/full-page-promo.spec.ts passes 6/6.

@DrJKL
DrJKL requested a review from a team September 29, 2026 23:19
@DrJKL
DrJKL requested a review from dante01yoon as a code owner September 29, 2026 23:19
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: ebb10b58-b34b-4371-baa3-c170c5866847

📥 Commits

Reviewing files that changed from the base of the PR and between 156813d and bbc20b9.

📒 Files selected for processing (3)
  • apps/billing-web/src/checkout/payVerdict.test.ts
  • apps/billing-web/src/checkout/payVerdict.ts
  • apps/billing-web/src/views/FullPageCheckoutView.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. Your free on-demand review promotion remains active until October 9, 2026 at 6:00 PM UTC.


📝 Walkthrough

Walkthrough

Checkout now maps QUOTE_STALE to the quote_expired requote verdict. The stale-quote tests supply QUOTE_STALE directly instead of a failed request with server code SUBSCRIPTION_QUOTE_STALE.

Changes

Checkout stale quote handling

Layer / File(s) Summary
Stale quote verdict and tests
apps/billing-web/src/checkout/payVerdict.ts, apps/billing-web/src/checkout/payVerdict.test.ts, apps/billing-web/src/views/FullPageCheckoutView.test.ts
payVerdictOf maps QUOTE_STALE to the quote_expired requote verdict. SUBSCRIPTION_QUOTE_STALE is removed from the server-code check. Both tests now supply QUOTE_STALE directly. The promo-code test continues to check that the expired promo is removed and checkout returns to the undiscounted price.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to bbc20

The change restores re-quoting for stale checkout quotes without treating server failures as quote expiry. No merge-blocking risk remains on the supplied evidence.

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
End-To-End Regression Coverage For Fixes ⚠️ Warning The PR uses bug-fix language in the title and commit subject: fix. It changes frontend application files under apps/billing-web/src/ and does not change a file under browser_tests/. The PR descr… Add or update a Playwright regression test under browser_tests/, or add a concrete explanation in the PR description of why an end-to-end regression test is not practical.
✅ Passed checks (6 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Website End-To-End Regression Coverage ✅ Passed No files under apps/website/src/ or apps/website/public/ changed. The PR changes apps/billing-web runtime and tests only, so this website-specific check does not apply.
Adr Compliance For Entity/Litegraph Changes ✅ Passed The changed files are under apps/billing-web/src/checkout/ and apps/billing-web/src/views/. None are under src/lib/litegraph/, src/ecs/, or related graph-entity paths. The ADR compliance check…
Title check ✅ Passed The title clearly and concisely describes the main change: re-quoting the full-page checkout when the result code is QUOTE_STALE.
Description check ✅ Passed The description includes the required Summary, Changes, and Review Focus sections. It explains the bug, the code change, the result-shape correction, and test coverage. The optional Breaking, Dependen…
Full details: End-To-End Regression Coverage For Fixes

Explanation

The PR uses bug-fix language in the title and commit subject: fix. It changes frontend application files under apps/billing-web/src/ and does not change a file under browser_tests/. The PR description reports existing end-to-end test results, but it does not give a concrete explanation for why an end-to-end regression test was not added.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🌾 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 156813d1db380b50e45fb7dfbe91f52276e2bf18

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

🎭 Playwright: 🕵🏻 0 passed, 0 failed

📊 Browser Reports
  • chromium: ❌ Deployment failed
  • chromium-2x: ❌ Deployment failed
  • chromium-0.5x: ❌ Deployment failed
  • mobile-chrome: ❌ Deployment failed

@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main   #19499      +/-   ##
==========================================
+ Coverage   84.28%   85.13%   +0.85%     
==========================================
  Files        3286     2410     -876     
  Lines      158348   135875   -22473     
  Branches    43025    36718    -6307     
==========================================
- Hits       133463   115678   -17785     
+ Misses      23060    19728    -3332     
+ Partials     1825      469    -1356     
Flag Coverage Δ
billing-web-unit 91.86% <100.00%> (+<0.01%) ⬆️
website-unit ?

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

Files with missing lines Coverage Δ
apps/billing-web/src/checkout/payVerdict.ts 97.72% <100.00%> (+0.05%) ⬆️

... and 876 files with indirect coverage changes

🚀 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.

@github-actions github-actions Bot added the risk:medium PR risk grade (advisory shadow check; grader-owned) label Sep 29, 2026
@dante01yoon dante01yoon assigned DrJKL and unassigned dante01yoon and benjcooley Sep 29, 2026
@DrJKL
DrJKL added this pull request to the merge queue Sep 29, 2026
@christian-byrne christian-byrne removed their assignment Sep 30, 2026
Merged via the queue into main with commit 9fa2eb0 Sep 30, 2026
85 checks passed
@DrJKL
DrJKL deleted the drjkl/fix-billing-quote-stale-requote branch September 30, 2026 00:04
claude Bot pushed a commit that referenced this pull request Sep 30, 2026
…19499)

## Summary

Fixes the `full-page-promo.spec.ts` "a code that lapses before Pay"
failure that has been red on main since #19126. The full-page checkout
now re-quotes when a subscribe comes back as `QUOTE_STALE`.

## Changes

- **What**: #19253 made `payVerdictOf` re-quote only when a raw
`SUBSCRIPTION_QUOTE_STALE` `serverCode` came back. #19126 then changed
account-core to turn a 4xx with that code into `{ code: 'QUOTE_STALE' }`
with no `serverCode`. The two PRs were written in parallel and merged
about 40 minutes apart. Since then, `payVerdictOf` falls through to
`failure`. The page shows "Your quote changed…" instead of re-pricing
and showing the expired-promo card. `payVerdictOf` now maps
`QUOTE_STALE` to `requote`.
- The `payVerdict` and `FullPageCheckoutView` unit tests built the
pre-#19126 result shape by hand, so they missed this. They now use the
shape account-core actually returns.

## Review Focus

`SUBSCRIPTION_QUOTE_STALE` is gone from `STALE_QUOTE_SERVER_CODES`. Only
`subscribe` emits it, and account-core now maps it for 4xx responses. A
5xx that echoes the code arrives as `REQUEST_FAILED`, which account-core
treats as an upstream failure, not a stale quote. With this change, that
5xx no longer triggers a re-quote.

Red/green: both updated unit tests fail without the `payVerdict.ts`
change and pass with it. `pnpm test:e2e:local
e2e/full-page-promo.spec.ts` passes 6/6.
claude Bot pushed a commit that referenced this pull request Sep 30, 2026
…19499)

## Summary

Fixes the `full-page-promo.spec.ts` "a code that lapses before Pay"
failure that has been red on main since #19126. The full-page checkout
now re-quotes when a subscribe comes back as `QUOTE_STALE`.

## Changes

- **What**: #19253 made `payVerdictOf` re-quote only when a raw
`SUBSCRIPTION_QUOTE_STALE` `serverCode` came back. #19126 then changed
account-core to turn a 4xx with that code into `{ code: 'QUOTE_STALE' }`
with no `serverCode`. The two PRs were written in parallel and merged
about 40 minutes apart. Since then, `payVerdictOf` falls through to
`failure`. The page shows "Your quote changed…" instead of re-pricing
and showing the expired-promo card. `payVerdictOf` now maps
`QUOTE_STALE` to `requote`.
- The `payVerdict` and `FullPageCheckoutView` unit tests built the
pre-#19126 result shape by hand, so they missed this. They now use the
shape account-core actually returns.

## Review Focus

`SUBSCRIPTION_QUOTE_STALE` is gone from `STALE_QUOTE_SERVER_CODES`. Only
`subscribe` emits it, and account-core now maps it for 4xx responses. A
5xx that echoes the code arrives as `REQUEST_FAILED`, which account-core
treats as an upstream failure, not a stale quote. With this change, that
5xx no longer triggers a re-quote.

Red/green: both updated unit tests fail without the `payVerdict.ts`
change and pass with it. `pnpm test:e2e:local
e2e/full-page-promo.spec.ts` passes 6/6.
christian-byrne pushed a commit that referenced this pull request Sep 30, 2026
…19499)

## Summary

Fixes the `full-page-promo.spec.ts` "a code that lapses before Pay"
failure that has been red on main since #19126. The full-page checkout
now re-quotes when a subscribe comes back as `QUOTE_STALE`.

## Changes

- **What**: #19253 made `payVerdictOf` re-quote only when a raw
`SUBSCRIPTION_QUOTE_STALE` `serverCode` came back. #19126 then changed
account-core to turn a 4xx with that code into `{ code: 'QUOTE_STALE' }`
with no `serverCode`. The two PRs were written in parallel and merged
about 40 minutes apart. Since then, `payVerdictOf` falls through to
`failure`. The page shows "Your quote changed…" instead of re-pricing
and showing the expired-promo card. `payVerdictOf` now maps
`QUOTE_STALE` to `requote`.
- The `payVerdict` and `FullPageCheckoutView` unit tests built the
pre-#19126 result shape by hand, so they missed this. They now use the
shape account-core actually returns.

## Review Focus

`SUBSCRIPTION_QUOTE_STALE` is gone from `STALE_QUOTE_SERVER_CODES`. Only
`subscribe` emits it, and account-core now maps it for 4xx responses. A
5xx that echoes the code arrives as `REQUEST_FAILED`, which account-core
treats as an upstream failure, not a stale quote. With this change, that
5xx no longer triggers a re-quote.

Red/green: both updated unit tests fail without the `payVerdict.ts`
change and pass with it. `pnpm test:e2e:local
e2e/full-page-promo.spec.ts` passes 6/6.
christian-byrne pushed a commit that referenced this pull request Sep 30, 2026
…19499)

## Summary

Fixes the `full-page-promo.spec.ts` "a code that lapses before Pay"
failure that has been red on main since #19126. The full-page checkout
now re-quotes when a subscribe comes back as `QUOTE_STALE`.

## Changes

- **What**: #19253 made `payVerdictOf` re-quote only when a raw
`SUBSCRIPTION_QUOTE_STALE` `serverCode` came back. #19126 then changed
account-core to turn a 4xx with that code into `{ code: 'QUOTE_STALE' }`
with no `serverCode`. The two PRs were written in parallel and merged
about 40 minutes apart. Since then, `payVerdictOf` falls through to
`failure`. The page shows "Your quote changed…" instead of re-pricing
and showing the expired-promo card. `payVerdictOf` now maps
`QUOTE_STALE` to `requote`.
- The `payVerdict` and `FullPageCheckoutView` unit tests built the
pre-#19126 result shape by hand, so they missed this. They now use the
shape account-core actually returns.

## Review Focus

`SUBSCRIPTION_QUOTE_STALE` is gone from `STALE_QUOTE_SERVER_CODES`. Only
`subscribe` emits it, and account-core now maps it for 4xx responses. A
5xx that echoes the code arrives as `REQUEST_FAILED`, which account-core
treats as an upstream failure, not a stale quote. With this change, that
5xx no longer triggers a re-quote.

Red/green: both updated unit tests fail without the `payVerdict.ts`
change and pass with it. `pnpm test:e2e:local
e2e/full-page-promo.spec.ts` passes 6/6.
christian-byrne added a commit that referenced this pull request Sep 30, 2026
… full-page checkout (#19643)

## Summary

Backports #19499 to `core/1.55` so the full-page promo flow handles
account-core's current `{ code: 'QUOTE_STALE' }` result and re-quotes
instead of showing the generic quote-changed failure.

## Scope

- Cherry-picks merged commit `9fa2eb037f` with provenance.
- Changes only `payVerdictOf` and its two existing focused test files (3
files, +5/-13).
- Does not import website/catalog content or alter billing assertions.

## Verification

- Red on the target implementation with the updated source tests: 2
failures / 126 passes; `QUOTE_STALE` falls through to `failure`, and the
promo case shows generic quote-changed copy.
- Green at this head: 128/128 focused Vitest tests.
- `pnpm typecheck` passed for `@comfyorg/billing-web`.
- `pnpm lint` passed for `@comfyorg/billing-web`.
- The local Playwright suite is blocked before checkout behavior by
release-branch auth-route drift (`/cloud/login` versus the fixture's
`/sign-in` expectation); hosted `billing-web-e2e` remains required and
is not waived.

Backport of #19499.

Co-authored-by: Alexander Brown <drjkl@comfy.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:medium PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants