Skip to content

fix(web): prevent false subscription cancellation error toast - #1091

Merged
AchoArnold merged 1 commit into
mainfrom
fix/subscription-cancellation-response
Nov 24, 2026
Merged

AchoArnold merged 1 commit into
mainfrom
fix/subscription-cancellation-response

Conversation

@AchoArnold

Copy link
Copy Markdown
Member

Summary

  • The cancellation API returns HTTP 204 No Content. The billing store previously read response.message from the undefined response, throwing after the subscription had already been cancelled.
  • Make cancellation return Promise without reading a response body, preserving the existing success toast and redirect and allowing genuine API errors to reach the error handler.
  • Add regression tests for empty successful responses and propagated API failures.

Verification

  • Reproduced the original TypeError with the regression test before applying the fix.
  • Web test suite: 89 tests passed.
  • Final focused regression tests, ESLint, Prettier, vue-tsc --noEmit, and git diff --check passed.

Treat the cancellation endpoint's 204 response as a successful void result.
Do not read a missing message after cancellation succeeds.
Add regression coverage for bodyless success and API failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ed7b2928-caae-4667-8285-9b3c3f31bca4
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 10 complexity · 0 duplication

Metric Results
Complexity 10
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Fixes the false cancellation error by awaiting the request without reading an empty response.

  • Subscription cancellation succeeds with an empty API response.

Reviews (1) · Last reviewed commit: "fix(web): handle empty subscription canc..." · Reviewed by Greptile

Copilot AI 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.

🟢 Approval recommended

There are no active review issues for the subscription-cancellation change.

No open issues 🎉

What changed in this PR

Fixes the false error toast after a successful subscription cancellation by handling the API’s empty HTTP 204 response correctly.

Changes:

  • Updates cancellation to return Promise<void> without reading a response body, while preserving API error propagation.
  • Adds regression tests for empty successful responses and API failures.
File Description
web/​app/​stores/​billing.ts Removes response-body access from subscription cancellation.
web/​app/​stores/​billing.test.ts Tests successful cancellation and error propagation.

Review effort: Balanced

@AchoArnold
AchoArnold merged commit feb1f4e into main Nov 24, 2026
15 checks passed
@AchoArnold
AchoArnold deleted the fix/subscription-cancellation-response branch November 24, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants