Skip to content

[backport core/1.55] fix(billing-web): re-quote on QUOTE_STALE in the full-page checkout - #19643

Merged
christian-byrne merged 1 commit into
core/1.55from
backport-19499-to-core-1.55
Sep 30, 2026
Merged

christian-byrne merged 1 commit into
core/1.55from
backport-19499-to-core-1.55

Conversation

@christian-byrne

Copy link
Copy Markdown
Contributor

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.

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

(cherry picked from commit 9fa2eb0)
@christian-byrne
christian-byrne requested review from a team and dante01yoon as code owners September 30, 2026 17:40
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (2)
  • [release]
  • [backport

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Team

Run ID: 5cd10d75-c44c-4239-8a6b-789d14795b70

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@christian-byrne christian-byrne added the cursor-review Trigger multi-model Cursor agent review on this PR label Sep 30, 2026

@christian-byrne christian-byrne left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Self-review under the recorded core/1.55 release-backport authority: compared the exact three-file carrier range against merged #19499 and the live release target. The cherry-pick is clean and provenance-preserving; the updated tests reproduce the target defect when the production hunk is removed (2 focused failures) and pass 128/128 at head 6cef52b. Billing-web typecheck and lint pass. No unrelated content or weakened assertion is present. Hosted billing-web-e2e remains required because the local release-branch harness currently stops at auth-route drift.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🧩 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

📦 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 7c1c1c608c47882de3b9339b9d647415c4497a23

Full docs: ADR-DEVEX-LINT-0015

@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@              Coverage Diff              @@
##           core/1.55   #19643      +/-   ##
=============================================
+ Coverage      84.65%   84.75%   +0.09%     
=============================================
  Files           2314     2381      +67     
  Lines         131531   133462    +1931     
  Branches       35095    35734     +639     
=============================================
+ Hits          111353   113119    +1766     
- Misses         19820    19893      +73     
- Partials         358      450      +92     
Flag Coverage Δ
billing-web-unit 91.45% <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/checkout/payVerdict.ts 97.72% <100.00%> (ø)

... and 66 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:high PR risk grade (advisory shadow check; grader-owned) label Sep 30, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Cursor Review — Consolidated panel

Triggered by @christian-byrne.

Found 3 finding(s).

Severity Count
🟡 Medium 1
🟢 Low 2

Panel: 8/8 reviewers contributed findings.

'PRORATION_QUOTE_EXPIRED',
'SUBSCRIPTION_QUOTE_STALE'
] as const
const STALE_QUOTE_SERVER_CODES = ['PRORATION_QUOTE_EXPIRED'] as const

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium — PRORATION_QUOTE_EXPIRED is still matched through matchesServerCode, which ignores httpStatus, while stale subscription quotes now depend on the command layer's QUOTE_STALE normalization that refusedWith only applies to 4xx — so the two stale-quote codes are trusted under different conditions. A 5xx from /billing/subscribe echoing PRORATION_QUOTE_EXPIRED therefore still yields requote, telling the customer the price was refreshed and they were not charged and skipping the OPERATION_ALREADY_PENDING/CONFLICT reconcile branch, even though the subscribe outcome is unknown and an operation may be in flight. Gate this match on a 4xx too, or move it beside the QUOTE_STALE mapping in subscriptionCommands.ts. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max edge-case).

)
return { kind: 'requote', because: 'quote_expired' }
switch (result.code) {
case 'QUOTE_STALE':

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Low — Dropping SUBSCRIPTION_QUOTE_STALE from the server-code list makes stale-quote recognition depend entirely on issueSubscribe's 4xx-gated refusedWith mapping, so a response carrying that raw server code with a 5xx status now falls through to a generic {kind:'failure', code:'REQUEST_FAILED'} where it previously re-priced. Distrusting 5xx state is defensible, but it is an unremarked user-visible change and the view layer keeps no fallback if that single mapping is renamed or its status gate shifts. Confirm the change is intended and pin the 5xx outcome with a test. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max edge-case).

{
name: 'a stale subscription quote',
result: refusedWith('REQUEST_FAILED', 'SUBSCRIPTION_QUOTE_STALE'),
result: { status: 'error', code: 'QUOTE_STALE' },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Low — This row was replaced rather than added alongside, so nothing in the suite still covers a REQUEST_FAILED failure carrying serverCode: 'SUBSCRIPTION_QUOTE_STALE' — exactly the shape whose verdict changed from requote to a hard failure. The remaining server-code row also builds its fixture with refusedWith, which hardcodes httpStatus: 409, so the status-blind PRORATION_QUOTE_EXPIRED match is never exercised with a 5xx; keep both rows and add a 5xx case. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).

@christian-byrne

Copy link
Copy Markdown
Contributor Author

Justification: authorized core/1.55 backport; exact head 6cef52b is human-approved and all required checks are green. The target advanced by two commits after this head was tested; the exact-head gate measured zero file overlap between those target-only commits and this PR, so the untested delta cannot interact with the one-file billing repair.

@christian-byrne
christian-byrne merged commit 7a50330 into core/1.55 Sep 30, 2026
106 checks passed
@christian-byrne
christian-byrne deleted the backport-19499-to-core-1.55 branch September 30, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cursor-review Trigger multi-model Cursor agent review on this PR risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants