Skip to content

fix(deposit): prevent user-cancelled errors from being sent to Sentry - #2583

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

sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/sentry-deposit-cancel

Conversation

@sentry

@sentry sentry Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

This PR addresses issue SOLID-VA where Sentry was receiving "Error: User cancelled transaction" events from the deposit flow.

Root Cause:
The captureDepositError function in lib/deposit/telemetry.ts unconditionally called Sentry.captureException for all errors. When a user intentionally cancelled a deposit transaction, hooks/useDepositFromSolidUsdc.ts would throw new Error('User cancelled transaction'), which was then captured by Sentry as an error, leading to noise in error monitoring.

Solution:

  1. Guard Sentry.captureException: Modified captureDepositError to check if the error is a user cancellation using isUserCancelledError (from @/lib/utils/withdrawErrors). Sentry.captureException is now only called for genuine errors, aligning with the existing pattern in the withdraw flow (hooks/useWithdraw.ts).
  2. Preserve Analytics: Added a user_cancelled flag to the TRACKING_EVENTS.DEPOSIT_ERROR analytics event. This ensures that user cancellations are still tracked for analytical purposes without generating Sentry alerts.
  3. New Test File: Added lib/deposit/__tests__/telemetry.test.ts to specifically test the behavior of captureDepositError, ensuring Sentry is correctly bypassed for user cancellations and still captures other errors.

This change reduces Sentry noise by filtering out expected user interactions while maintaining visibility into these events for analytics.

Fixes SOLID-VA

@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 24, 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 24, 2026 10:35pm UTC
solid-app-staging Ignored Ignored Preview Sep 24, 2026 10:35pm 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