Skip to content

Fix Sentry noise from cancelled queries during logout - #2529

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

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

Conversation

@sentry

@sentry sentry Bot commented Sep 19, 2026

Copy link
Copy Markdown

This PR addresses an issue where CancelledError from TanStack Query was being reported to Sentry as a legitimate error during user logout, leading to unnecessary noise.

Root Cause:
During logout, handleLogout in useUser.ts calls queryClient.clear(), which cancels all pending TanStack queries. The fetchIsDeposited query, awaited in usePostSignupInit.ts, would then reject with a CancelledError. The catch block in usePostSignupInit.ts was unconditionally reporting all errors to Sentry, including these intentional cancellations.

Fix:
Modified hooks/usePostSignupInit.ts to import isCancelledError from @tanstack/react-query and added a guard in the fetchIsDeposited catch block. Now, if the caught error is an isCancelledError, it is silently ignored, preventing false Sentry reports.

Verification:

  • npm install --legacy-peer-deps
  • npx expo lint --fix hooks/usePostSignupInit.ts (auto-fixed import sort, pre-existing react-compiler error remains)
  • npx jest --testPathPattern="usePostSignupInit|useUser" (all tests passed)

Fixes SOLID-WN

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

@vercel

vercel Bot commented Sep 19, 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 19, 2026 10:34am UTC
solid-app-staging Ignored Ignored Preview Sep 19, 2026 10:34am UTC

Request Review

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