Skip to content

fix: silence CancelledError Sentry reports in usePostSignupInit - #2567

Open
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/sentry-cancelled-error-lzGosW
Open

sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/sentry-cancelled-error-lzGosW

Conversation

@sentry

@sentry sentry Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

This PR addresses an issue where CancelledError exceptions were being incorrectly reported to Sentry from the usePostSignupInit hook.

Problem:
When a user's session expires or they log out, handleSessionExpired (in hooks/useUser.ts) calls queryClient.clear(). This action cancels all in-flight TanStack Query fetches, causing them to reject with a CancelledError. The fetchIsDeposited call within usePostSignupInit.ts was susceptible to this, and its catch block was unconditionally capturing these expected CancelledError instances and sending them to Sentry as balance_check_error_lazy warnings.

Solution:
Added a guard in the fetchIsDeposited catch block within hooks/usePostSignupInit.ts to check if the caught error is a CancelledError. If it is, the error is silently ignored, preventing it from being reported to Sentry. This aligns with the existing pattern for handling AbortError in lib/utils/utils.ts.

Verification:

  • Added a new unit test file (hooks/__tests__/usePostSignupInit.test.ts) to specifically verify that CancelledError is not reported to Sentry, while other unexpected errors still are.
  • Ran npm run lint and npm test to ensure no new issues were introduced.

Fixes SOLID-W7

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
solid-app Ignored Ignored Preview Sep 23, 2026 10:39pm UTC
solid-app-staging Ignored Ignored Preview Sep 23, 2026 10:39pm UTC

Request Review

This branch has not been deployed

No deployments
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.

0 participants