🥅 app: deduplicate and fingerprint unknown passkey sentry reports#739
🥅 app: deduplicate and fingerprint unknown passkey sentry reports#739cruzdanilo merged 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: f7de431 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis PR adds error fingerprinting and deduplication improvements for Sentry reporting. A changeset entry documents the feature. The server utility consolidates error suppression logic and expands it to cover additional error types (ValiError, NotAllowedError, UnknownError, Apple AuthenticationServices errors, and device unlock/cancellation messages). The auth utility now conditionally attaches fingerprint data to error reports based on error code properties. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @cruzdanilo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the application's error management, particularly concerning passkey authentication failures. It introduces logic to prevent the query client from retrying specific known passkey errors and implements a more robust Sentry reporting mechanism by fingerprinting errors based on their unique codes, which will help in identifying and managing recurring issues more efficiently. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses the goal of deduplicating and fingerprinting unknown passkey errors for Sentry reporting. The changes in src/utils/server.ts correctly suppress known, non-critical errors, while the modifications in src/utils/useAuth.ts add fingerprinting for errors that have a code property. The suggestion to enhance type safety of the new error reporting logic is valid and has been kept.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #739 +/- ##
==========================================
- Coverage 67.28% 67.27% -0.01%
==========================================
Files 206 206
Lines 6908 6909 +1
Branches 2147 2151 +4
==========================================
Hits 4648 4648
- Misses 2077 2078 +1
Partials 183 183
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/utils/server.ts`:
- Around line 64-76: The suppressError predicate embedded in the suppressError
option (referencing ValiError and the long series of platform-specific message
checks) is duplicated across server.ts, useAuth.ts and accountClient.ts; extract
the platform/cancellation checks into a shared helper function named
isPasskeyCancellation(error): boolean in a common utils module and replace the
repeated inline checks in suppressError and any similar predicates with calls to
isPasskeyCancellation(error), keeping any file-specific conditions layered on
top (e.g., retain ValiError checks inside suppressError while delegating
Apple/Android/UserCancelled/device-unlock logic to the new helper).
In `@src/utils/useAuth.ts`:
- Around line 87-92: The fingerprint construction passed to reportError can end
up with a non-string because the "(error as Error & { code: string }).code" cast
only affects types; update the logic around reportError (in useAuth.ts where
reportError is called and APIError is checked) to coerce the code to a string
(e.g., use String(error.code)) when building the fingerprint array while
preserving the existing existence and APIError checks.
Summary by CodeRabbit
Release Notes