fix: handle Supabase 403 error when listing branches for free tier users (#2527)
## Summary
- Handle 403 Forbidden errors gracefully when listing Supabase branches
- Return empty array instead of throwing error for free tier users
without branch access
- Allows free tier users to continue using other Supabase features
without error toasts
Fixes #2525
## Test plan
- Verified all 784 unit tests pass
- Existing E2E test (`supabase_branch.spec.ts`) continues to work for
paid tier (test mode returns mock data)
- Free tier users should now see no branches available instead of an
error toast
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2527"
target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
</picture>
</a>
<!-- devin-review-badge-end -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Show a clear inline message when Supabase branch listing returns 403 for
free‑tier projects, and suppress error toasts so users can keep using
other Supabase features (addresses #2525).
- **Bug Fixes**
- Detect 403 from branches API and show “Branches are only supported for
Supabase paid customers” in the UI; no toast.
- Removed toast meta from the branches query and added getErrorMessage
to clean up IPC-wrapped errors.
- Other statuses keep existing handling; paid tier behavior unchanged.
<sup>Written for commit eb414f84c5c4ff44a4f6f152aae5c395903430b3.
Summary will update on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by:
Will Chen <willchen90@gmail.com>
Co-authored-by:
Claude Opus 4.5 <noreply@anthropic.com>
正在显示
差异被折叠。
src/lib/errors.ts
0 → 100644
请
注册
或者
登录
后发表评论