Repository navigation
[backport cloud/1.48] fix(billing): don't show an error when a checkout is superseded - #14710
Merged
Merged
Conversation
## 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
enabled auto-merge (squash)
August 4, 2026 21:10
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
Contributor
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1762 passed, 0 failed · 3 flaky📊 Browser Reports
|
wei-hai
approved these changes
Aug 4, 2026
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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #14705 to
cloud/1.48Automatically created by backport workflow.