Repository navigation
[backport core/1.55] fix(billing-web): re-quote on QUOTE_STALE in the full-page checkout - #19643
Conversation
…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)
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
christian-byrne
left a comment
There was a problem hiding this comment.
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.
🧩 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 📦 Bundle Size
🌾 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 7c1c1c608c47882de3b9339b9d647415c4497a23
Full docs: ADR-DEVEX-LINT-0015 |
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
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 66 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔍 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 |
There was a problem hiding this comment.
🟡 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': |
There was a problem hiding this comment.
🟢 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' }, |
There was a problem hiding this comment.
🟢 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).
|
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. |
Summary
Backports #19499 to
core/1.55so 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
9fa2eb037fwith provenance.payVerdictOfand its two existing focused test files (3 files, +5/-13).Verification
QUOTE_STALEfalls through tofailure, and the promo case shows generic quote-changed copy.pnpm typecheckpassed for@comfyorg/billing-web.pnpm lintpassed for@comfyorg/billing-web./cloud/loginversus the fixture's/sign-inexpectation); hostedbilling-web-e2eremains required and is not waived.Backport of #19499.