Skip to content

fix(web): show error state instead of empty state on invoice fetch failure - #559

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
arambu1a:fix/invoice-list-error-handling
Jul 30, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
arambu1a:fix/invoice-list-error-handling

Conversation

@arambu1a

@arambu1a arambu1a commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #550

Summary

  • invoice-list.tsx had no error handling on its fetch to /api/stripe/invoices — a failed request silently rendered "No invoices yet," indistinguishable from a real empty list
  • Now checks res.ok, parses the error body, and renders a distinct error state with a retry button, matching the pattern in agent-section.tsx

Test plan

  • Verified locally: forced a module-load-time Stripe crash (HTML 500) — error state renders correctly, not the empty state
  • Verified locally: forced a route-level JSON error ({error: "..."}, 500) — error message renders correctly, retry button works

…fails

The fetch to /api/stripe/invoices had no error handling, so a failed
request silently rendered the "No invoices yet" empty state — indistinguishable
from a real empty list. Now checks res.ok, parses the error body, and
renders a distinct error state with a retry button, matching the pattern
used in agent-section.tsx.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to Ansvisor, and thank you for your first PR! A maintainer will be by soon to review.

In the meantime, two things that make review faster:

  • A short description of why the change matters, not just what it does — most of our PRs link a Fixes #... to the issue that explains the why.
  • A quick local test note if there's anything worth eyeballing in the browser.

If you'd like to keep an eye on where Ansvisor goes next, a ⭐ on the repo helps others discover it (and Watch sends you a ping when related issues land). Either way — looking forward to your next one.

@gkhngyk gkhngyk 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.

Thanks — clean fix, matches the sibling settings components and the non-JSON 500 case is handled nicely. One small ask: could you add Closes #550 to the PR description so the issue auto-closes on merge?

@gkhngyk
gkhngyk merged commit f8119af into ansvisor:main Jul 30, 2026
4 checks passed
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.

Billing invoice list silently swallows API errors — customers with invoices can be shown "No invoices"

2 participants