Skip to content

Fix: iOS passkey cancellations logged as exceptions - #2534

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

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

Conversation

@sentry

@sentry sentry Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

This PR addresses an issue where user-cancelled passkey login prompts on iOS devices were incorrectly captured as exceptions in Sentry, rather than being treated as benign warnings.

Problem:
On iOS (Expo/React Native), when a user cancels a passkey login prompt, the error object received has error.name === 'UserCancelled' and a message like 'The user cancelled the request.'. The existing error handling in hooks/useUser.ts at line 434 only checked for error?.name === 'NotAllowedError' to identify user cancellations. As a result, iOS cancellations fell into the generic else block, triggering Sentry.captureException(new Error('Error logging in')).

Root Cause:
The isWebAuthnUserCancelledError helper in lib/execute.ts already contains logic to correctly identify various forms of user-cancelled WebAuthn prompts, including those with 'user cancelled' in the message. However, this helper was not being used in the login error handling path in hooks/useUser.ts.

Solution:

  1. Imported isWebAuthnUserCancelledError from @/lib/execute into hooks/useUser.ts.
  2. Modified the conditional check at line 434 in hooks/useUser.ts to include the isWebAuthnUserCancelledError(error) check. This ensures that iOS-specific cancellation errors are now correctly identified and logged as warnings, preventing unnecessary Sentry exceptions.
  3. Added a new test file lib/__tests__/execute.test.ts to specifically cover the isWebAuthnUserCancelledError helper, including a test case for the iOS UserCancelled error shape.

This change ensures that user-initiated cancellations are handled gracefully across all platforms, improving error reporting accuracy.

Fixes SOLID-ZN

@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 20, 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 20, 2026 10:36am UTC
solid-app-staging Ignored Ignored Preview Sep 20, 2026 10:36am 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