Skip to content

[backport cloud/1.48] fix(billing): don't show an error when a checkout is superseded - #14710

Merged
comfy-pr-bot merged 1 commit into
cloud/1.48from
backport-14705-to-cloud-1.48
Aug 4, 2026
Merged

comfy-pr-bot merged 1 commit into
cloud/1.48from
backport-14705-to-cloud-1.48

Conversation

@comfy-pr-bot

Copy link
Copy Markdown
Member

Backport of #14705 to cloud/1.48

Automatically created by backport workflow.

## What and why

Picking a different plan part-way through checkout makes the API replace
the pending subscription operation with a new one. The replaced
operation terminates as `failed` — it never completed — even though
nothing actually went wrong. The store treated that like any other
failure and showed **"We couldn't update your subscription. Please try
again."** while the replacement checkout was still running and about to
succeed.

Users hit this by starting a subscription, changing their mind, and
picking a different plan: an error toast, immediately followed by a
working subscription.

## The change

`handleFailure` now recognises the API's `checkout_superseded` failure
reason and skips the error toast for it. The operation is still recorded
as failed and still resolves normally — only the user-facing alarm goes
away.

The failure is also reported as `stale_operation` instead of `unknown`,
so a routine plan switch stops inflating the count of unexplained
billing failures. `stale_operation` is an existing category; no
telemetry types changed.

Takes effect once the API returns `checkout_superseded` for a replaced
checkout.

## Scope

One `if` and one telemetry value. Deliberately narrow:

- Genuine subscription failures still toast exactly as before.
- Top-up and cancel paths are untouched.
- The success path already ignores stale operations (it checks the
active checkout id before advancing), so it needed no change.

## Verification

- `vitest run
src/platform/workspace/stores/billingOperationStore.test.ts
src/platform/workspace/composables/useSubscriptionCheckout.test.ts
--coverage` — 144 passed, run **with** coverage to match CI.
- New regression test: a superseded operation raises no error toast and
reports `stale_operation`.
- `pnpm typecheck`, `oxfmt --check`, `eslint` — all clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Aug 4, 2026
@comfy-pr-bot
comfy-pr-bot enabled auto-merge (squash) August 4, 2026 21:10
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 4, 2026
@dosubot

dosubot Bot commented Aug 4, 2026

Copy link
Copy Markdown

📄 Knowledge review

Dosu skipped reviewing this PR because your organization has used its 200 included credits for the month. Your usage will reset on 2026-09-01. To have Dosu review this PR before then, ask your organization admin to upgrade to a pro account.


Leave Feedback Ask Dosu about ComfyUI_frontend Add Dosu to your team

@github-actions

github-actions Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 08/04/2026, 09:11:51 PM UTC

Links

🎭 Playwright: ✅ 1762 passed, 0 failed · 3 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1741 / ❌ 0 / ⚠️ 3 / ⏭️ 5)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@              Coverage Diff              @@
##             cloud/1.48   #14710   +/-   ##
=============================================
  Coverage              ?   69.31%           
=============================================
  Files                 ?     1662           
  Lines                 ?    85948           
  Branches              ?    24771           
=============================================
  Hits                  ?    59577           
  Misses                ?    26261           
  Partials              ?      110           
Flag Coverage Δ
unit 69.31% <100.00%> (?)

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

Files with missing lines Coverage Δ
...platform/workspace/stores/billingOperationStore.ts 99.10% <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 30ff10f into cloud/1.48 Aug 4, 2026
74 checks passed
@comfy-pr-bot
comfy-pr-bot deleted the backport-14705-to-cloud-1.48 branch August 4, 2026 21:23
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 size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants