Skip to content

FE-3056 fix(billing-web): re-quote a stale subscribe quote the way the app does - #19126

Merged
dante01yoon merged 102 commits into
mainfrom
jaewon/checkout-quote-stale-recovery
Sep 29, 2026
Merged

dante01yoon merged 102 commits into
mainfrom
jaewon/checkout-quote-stale-recovery

Conversation

@dante01yoon

@dante01yoon dante01yoon commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator
  • Linear: FE-3056

Why

When the server refuses a subscribe because the quote went stale, the embedded checkout re-quotes and tells the customer "Your quote changed. Review the updated amount and try again." billing-web instead shows "We couldn't reach the billing service. Please try again." and keeps the old quote, so every retry is refused the same way. Seen live on testcloud with a Team monthly → annual change (POST /api/billing/subscribe → 400 SUBSCRIPTION_QUOTE_STALE).

Root cause

issueSubscribe in packages/account-core/src/core/billing/subscriptionCommands.ts maps only REACTIVATION_CONFIRMATION_REQUIRED; any other coded 4xx reaches the host as a generic failure. CheckoutView.pay in billing-web has no branch for a stale quote, so the failure copy is the transport one. The app's legacy rail handles the code in useSubscriptionCheckout.recoverStaleQuote.

How

  • account-core: SUBSCRIPTION_QUOTE_STALE becomes the command code QUOTE_STALE, the same way the reactivation code is mapped.
  • billing-web: on QUOTE_STALE, re-quote the plan and show the app's copy ("Your quote changed. Review the updated amount and try again."); if the re-quote itself fails, show the app's "quote refresh failed" copy.
  • Tests: an account-core case for the mapping and a CheckoutView case for the re-quote and copy. Both fail before the fix.
  • Red: the two new tests fail locally on edd1324 (the CI run for that commit was cancelled by the fix push); green: CI on 2ca20d8.

The stale quotes themselves come from the server (non-deterministic renewal_at on preview for a monthly → annual change); that was reported to backend separately.

AS IS / TO BE

AS IS: billing-web monthly → annual shows "We couldn't reach the billing service" (server 400 SUBSCRIPTION_QUOTE_STALE); the same change in the embedded checkout then goes through.

m2-live-yearly-stale-quote-then-embedded-success.mp4

TO BE: Unit and view tests (CheckoutView re-quotes and shows "Your quote changed. Review the updated amount and try again."). The stale quote is intermittent server-side, so a live TO BE capture is pending the backend fix.

Stack

PR Title
#19097 FE-3045 drop the billing-web plan grid
#19098 FE-3046 A buttonVariants into design-system
#19099 FE-3046 B account-ui checkout surfaces
#19100 FE-3046 C app renders account-ui checkout
#19101 FE-3046 D billing-web shared checkout
#19104 FE-3046 E invite from the success step
#19105 FE-3047 F clear decline toasts on success
#19106 FE-3048 G return closes the tab
#19115 FE-3050 H CTA reachable
this PR FE-3056 I stale quote re-quoted
graph LR
  P97[#19097] --> A[#19098] --> B[#19099] --> C[#19100] --> D[#19101] --> E[#19104] --> F[#19105] --> G[#19106] --> H[#19115] --> I[FE-3056]:::me
  classDef me fill:#f9d71c,stroke:#333,color:#000
Loading

…resolved

A checkout entry named a plan but its return_to did not resolve through
buildReturnUrl, so the form rendered with a Back and Close that led
nowhere. readEntry now records UNKNOWN_RETURN_TARGET for that entry, the
same path a plan-less link takes.
…stem

The cva recipe behind Button.vue lived in the app, so a workspace package
could not render a button with the app's classes. It now ships from
@comfyorg/design-system/button.variants and every importer reads it there.
apps/website keeps its own copy.
…ants' into jaewon/account-ui-checkout-surfaces
…stem

The saved-method picker moves into @comfyorg/account-ui next, and it has to
render the app's select classes. The recipe now ships from
@comfyorg/design-system/select.variants and its three importers read it there.
…form and success

The cloud app's embedded checkout steps, as components billing-web can render
too: the new-subscription confirm (price breakdown, promo code, saved methods,
card form, 3DS and parked-checkout recovery), the plan-change confirm with its
reactivation disclosure, the terms notice and the success screen.

Hosts pass translated copy, the plan they resolved and the quote. The class
recipes and cn() are bundled into the published build, reka-ui is a peer.
…unt-ui

The new-subscription confirm, the plan-change confirm and the success step
now render @comfyorg/account-ui's checkout components. The app components keep
their props and events and bind the app's catalog, translations, Stripe key,
theme, subscription status and journey telemetry. The copies they replace
(the card-form wrapper, the terms note and the quote formatting helpers) are
deleted; their tests move to the package or to the binding.
billing-web resolves the plan it checks out from the quote, but the quote does
not carry the monthly credit grant the confirm shows. The tiers' prices and
grants move here so the app and billing-web read one table.
CheckoutView now renders the cloud app's checkout steps from
@comfyorg/account-ui in the app's dialog frame: the new-subscription confirm
with its saved-method picker, promo code and card form, the plan-change
confirm with its reactivation disclosure, and the success step. A plan change
still confirms without a card form (#18684).

EmbeddedCheckout, CheckoutPayment and CheckoutSubmit are deleted, with the
billing-web-only copy they carried.
…atalog its own entry

Both confirm templates exceeded the complexity gate. The new-subscription
confirm now composes a summary and a pay-actions component, and picks one pay
action in script; the plan-change confirm moves its reactivation banner and
plan block into components. Rendered markup is unchanged.

The tier catalog moves to @comfyorg/account-ui/billing/catalog, a TS-only
entry, so importing it does not pull Vue components into non-Vue consumers
such as the Playwright runner.
…/billing-web-shared-checkout

# Conflicts:
#	packages/account-ui/src/billing/checkout/index.ts
… outcomes

Checked step by step against the cloud app with the checkout parity harness
(same fixtures on both surfaces):

- A payment in flight keeps the confirm on screen with the pay action busy,
  and shows the app's processing or verify toast.
- A verification that fails in the tab shows the app's inline notice; a
  decline or timeout shows the app's error toast with its detail copy and
  leaves the confirm usable. The CheckoutSteps panel is gone.
- The frame reproduces what the app's page applies around the dialog: its
  dark palette stroke, dark colour scheme, and browser defaults for inputs,
  the select trigger and links (the app has no Tailwind preflight).
- Tailwind now sources all of account-ui's billing components, so the Stripe
  form's layout classes are generated.
…f CheckoutView

The plan resolution and the subscribe request move into pure, tested helpers
(both were over the complexity gate inline). CheckoutFrame renders its close
button from the design-system recipe, so account-ui no longer exports its
internal button, whose declarations named an unpublished type.
The team invite on billing-web's success step renders the app's email tags,
so the tag recipe ships from @comfyorg/design-system/tag.variants and its
four importers read it there.
listPendingInvites and createInvite for the workspace the transport's token
names, parsed against the generated contract, so a host that checks out a
team plan can invite the team without a second client.
A multi-seat subscribe on billing-web now ends on the app's success step
with its team invite: the same copy, email tags, pending-invite and seat-cap
hints, and one invite per address through the account-core invite commands,
sent to the workspace the entry link bound.

The invite UI lives in @comfyorg/account-ui (CheckoutTeamSuccess), and the
app's invite email rules move there with it. Inside the checkout frame the
browser defaults the app shows for inputs and links now sit in the base
layer, so utilities such as the tags input's text size still apply.
…e toasts

Red first: a decline the server reports after this tab's challenge failed is
toasted as a card decline, and the error toasts of earlier attempts stay over
the success step.
…n success

After a challenge failed in the tab, the server settles the payment as a
generic card decline, and both checkouts toasted "Your bank declined this
payment" over the verification failure they had just shown. The lifecycle
(account-core, used by billing-web and the app's SDK rail) and the app's
legacy poller now report that settle as the failed verification; a specific
server reason still stands.

A refused attempt's error toast was sticky, so after declines and a
successful retry it stayed over the success step. The checkout now removes
its attempt toasts when it reaches success.
Red first: Back/Close on billing-web navigate the billing tab to the product
instead of closing it, and the app leaves billing_result/billing_ref in the
address bar.
Back, Close and "Return to ComfyUI" navigated the billing tab to the
product, so the customer ended with two product tabs and billing_result in
the URL. The product opens billing in its own tab, so billing-web now closes
itself and falls back to the product's URL only for a tab it could not close
(one opened directly). The product already refreshes billing on return, and
now also strips billing_result/billing_ref from its URL on load.
The backend now records authentication_failed for a failed 3DS, so the
client-side override that re-derived it is gone. authentication_failed
and authentication_required keep mapping to the verification copy.
@christian-byrne christian-byrne removed their assignment Sep 29, 2026
@dante01yoon
dante01yoon requested review from christian-byrne and removed request for christian-byrne September 29, 2026 19:01

@christian-byrne christian-byrne 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.

Approved. The stale-quote regression now proves the distinct replacement amount is displayed and the retry submits the replacement quote rather than the invalidated original.

@dante01yoon
dante01yoon added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit e352169 Sep 29, 2026
134 checks passed
@dante01yoon
dante01yoon deleted the jaewon/checkout-quote-stale-recovery branch September 29, 2026 22:14
@comfy-pr-bot

Copy link
Copy Markdown
Member

⚠️ Backport to core/1.55 failed

Reason: Merge conflicts detected during cherry-pick of e352169

The auto-backport could not be completed automatically. Please backport
manually onto branch backport-19126-to-core-1.55 (from origin/core/1.55) and
open a PR to core/1.55.

This may be a stacking conflict rather than a real one. #19472, #19459 are still open against core/1.55. If this PR sits on top of any of them, the conflict will disappear once they merge — wait for that, then remove and re-add the needs-backport label to re-run this workflow.

📄 Conflicting files
apps/billing-web/src/views/CheckoutView.vue
🤖 Prompt for AI Agents
Backport PR #19126 (https://github.com/Comfy-Org/ComfyUI_frontend/pull/19126) to core/1.55.
Cherry-pick merge commit e352169b7bf4f5a79a9dd148d981cb1b41542576 onto new branch
backport-19126-to-core-1.55 from origin/core/1.55.
Resolve conflicts in: apps/billing-web/src/views/CheckoutView.vue .

> **This may be a stacking conflict rather than a real one.** #19472, #19459 are still open against `core/1.55`. If this PR sits on top of any of them, the conflict will disappear once they merge — wait for that, then remove and re-add the `needs-backport` label to re-run this workflow.

For test snapshots (browser_tests/**/*-snapshots/), accept PR version if
changed in original PR, else keep target. For package.json versions, keep
target branch. For pnpm-lock.yaml, regenerate with pnpm install.
Ask user for non-obvious conflicts.
Create PR titled "[backport core/1.55] <original title>" with label "backport".
See .github/workflows/pr-backport.yaml for workflow details.

cc @dante01yoon

@comfy-pr-bot

Copy link
Copy Markdown
Member

⚠️ Backport to cloud/1.55 failed

Reason: Merge conflicts detected during cherry-pick of e352169

The auto-backport could not be completed automatically. Please backport
manually onto branch backport-19126-to-cloud-1.55 (from origin/cloud/1.55) and
open a PR to cloud/1.55.

This may be a stacking conflict rather than a real one. #19471, #19460, #19447 are still open against cloud/1.55. If this PR sits on top of any of them, the conflict will disappear once they merge — wait for that, then remove and re-add the needs-backport label to re-run this workflow.

📄 Conflicting files
apps/billing-web/src/views/CheckoutView.vue
🤖 Prompt for AI Agents
Backport PR #19126 (https://github.com/Comfy-Org/ComfyUI_frontend/pull/19126) to cloud/1.55.
Cherry-pick merge commit e352169b7bf4f5a79a9dd148d981cb1b41542576 onto new branch
backport-19126-to-cloud-1.55 from origin/cloud/1.55.
Resolve conflicts in: apps/billing-web/src/views/CheckoutView.vue .

> **This may be a stacking conflict rather than a real one.** #19471, #19460, #19447 are still open against `cloud/1.55`. If this PR sits on top of any of them, the conflict will disappear once they merge — wait for that, then remove and re-add the `needs-backport` label to re-run this workflow.

For test snapshots (browser_tests/**/*-snapshots/), accept PR version if
changed in original PR, else keep target. For package.json versions, keep
target branch. For pnpm-lock.yaml, regenerate with pnpm install.
Ask user for non-obvious conflicts.
Create PR titled "[backport cloud/1.55] <original title>" with label "backport".
See .github/workflows/pr-backport.yaml for workflow details.

cc @dante01yoon

@dante01yoon

Copy link
Copy Markdown
Collaborator Author

dante01yoon added a commit that referenced this pull request Sep 29, 2026
…ribe quote the way the app does (#19481)

## Why

When the server refuses a subscribe because the quote went stale (400
`SUBSCRIPTION_QUOTE_STALE`), billing-web shows "We couldn't reach the
billing service" and keeps the old quote, so every retry is refused the
same way. The embedded checkout already re-quotes.

## Root cause

`issueSubscribe` in
`packages/account-core/src/core/billing/subscriptionCommands.ts` did not
map the stale-quote code, and `CheckoutView.pay` had no branch for it.

## How

The SDK maps a 4xx `SUBSCRIPTION_QUOTE_STALE` to `QUOTE_STALE`.
`CheckoutView.pay` clears `quoteIsCurrent`, re-quotes, and shows "Your
quote changed" or "couldn't be refreshed" copy.

## AS IS / TO BE

Same as #19126, which carries the AS IS description and the TO BE test
evidence. This backport does not change behavior relative to main.

Backport of #19126 to `core/1.55`. Cherry-picked with `-x` from
e352169.

## Conflicts

One file, `apps/billing-web/src/views/CheckoutView.vue`, two hunks. Both
took the #19126 side.

- `useHostedCopy()` destructure: 1.55 had `{ refusal }` (FE-2642,
backported in #19305). #19126 needs `coded` back for the stale-quote
copy, so it is `{ coded, refusal }`.
- `pay()`: 1.55 ends with `submitFailure.value = refusal(result)`. The
`QUOTE_STALE` branch (clear `quoteIsCurrent`, re-quote, show "Your quote
changed" or "couldn't be refreshed") is inserted before it, as on main.

The FE-2642 parts of the squash (`useHostedCopy.refusal`, its call sites
in the panels and `InvoicesView`, and the "shows the reason the server
gave for a refused quote" test) were already on `core/1.55` and applied
as no-ops. The SDK mapping in `subscriptionCommands.ts` (`refusedWith`
for a 4xx `SUBSCRIPTION_QUOTE_STALE`, `refusedWhilePending` otherwise),
the two locale strings, and the new tests applied cleanly.

## Verification

- `pnpm typecheck` (all five stages) passes.
- billing-web vitest: 23 files, 280 tests pass, including "re-quotes a
stale quote and pays against the replacement" and "keeps Confirm closed
on the stale quote when its refresh fails".
- account-core vitest: 68 files, 1235 tests pass, including the 400 →
`QUOTE_STALE` / 503 → `REQUEST_FAILED` table.
- eslint, oxlint, and oxfmt clean on the changed files.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
comfy-pr-bot pushed a commit that referenced this pull request Sep 29, 2026
…cribe quote the way the app does (#19482)

## Why

When the server refuses a subscribe because the quote went stale (400
`SUBSCRIPTION_QUOTE_STALE`), billing-web shows "We couldn't reach the
billing service" and keeps the old quote, so every retry is refused the
same way. The embedded checkout already re-quotes.

## Root cause

`issueSubscribe` in
`packages/account-core/src/core/billing/subscriptionCommands.ts` did not
map the stale-quote code, and `CheckoutView.pay` had no branch for it.

## How

The SDK maps a 4xx `SUBSCRIPTION_QUOTE_STALE` to `QUOTE_STALE`.
`CheckoutView.pay` clears `quoteIsCurrent`, re-quotes, and shows "Your
quote changed" or "couldn't be refreshed" copy.

## AS IS / TO BE

Same as #19126, which carries the AS IS description and the TO BE test
evidence. This backport does not change behavior relative to main.

Backport of #19126 to `cloud/1.55`. Cherry-picked with `-x` from
e352169.

## Conflicts

One file, `apps/billing-web/src/views/CheckoutView.vue`, two hunks. Both
took the #19126 side.

- `useHostedCopy()` destructure: 1.55 had `{ refusal }` (FE-2642,
backported in #19304). #19126 needs `coded` back for the stale-quote
copy, so it is `{ coded, refusal }`.
- `pay()`: 1.55 ends with `submitFailure.value = refusal(result)`. The
`QUOTE_STALE` branch (clear `quoteIsCurrent`, re-quote, show "Your quote
changed" or "couldn't be refreshed") is inserted before it, as on main.

The FE-2642 parts of the squash (`useHostedCopy.refusal`, its call sites
in the panels and `InvoicesView`, and the "shows the reason the server
gave for a refused quote" test) were already on `cloud/1.55` and applied
as no-ops. The SDK mapping in `subscriptionCommands.ts` (`refusedWith`
for a 4xx `SUBSCRIPTION_QUOTE_STALE`, `refusedWhilePending` otherwise),
the two locale strings, and the new tests applied cleanly.

## Verification

- `pnpm typecheck` (all five stages) passes.
- billing-web vitest: 23 files, 280 tests pass, including "re-quotes a
stale quote and pays against the replacement" and "keeps Confirm closed
on the stale quote when its refresh fails".
- account-core vitest: 68 files, 1234 tests pass, including the 400 →
`QUOTE_STALE` / 503 → `REQUEST_FAILED` table.
- eslint, oxlint, and oxfmt clean on the changed files.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
christian-byrne pushed a commit to christian-byrne/ComfyUI_frontend that referenced this pull request Sep 30, 2026
…omfy-Org#19499)

## Summary

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

## Changes

- **What**: Comfy-Org#19253 made `payVerdictOf` re-quote only when a raw
`SUBSCRIPTION_QUOTE_STALE` `serverCode` came back. Comfy-Org#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-Comfy-Org#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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cloud/1.55 Backport PRs for cloud 1.55 core/1.55 Backport PRs for core 1.55 needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch risk:xhigh PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants