Repository navigation
fix(web): prevent false subscription cancellation error toast - #1091
Conversation
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
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 10 |
| Duplication | 0 |
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.
[Medium impact] The PR appears safe to merge. SummaryFixes the false cancellation error by awaiting the request without reading an empty response.
Reviews (1) · Last reviewed commit: "fix(web): handle empty subscription canc..." · Reviewed by Greptile |
There was a problem hiding this comment.
🟢 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
Summary
Verification