Skip to content

🥅 app: fingerprint passkey errors by message, drop expected ones#774

Merged
cruzdanilo merged 1 commit intomainfrom
catch
Feb 13, 2026
Merged

🥅 app: fingerprint passkey errors by message, drop expected ones#774
cruzdanilo merged 1 commit intomainfrom
catch

Conversation

@cruzdanilo
Copy link
Member

@cruzdanilo cruzdanilo commented Feb 13, 2026


Open with Devin

Summary by CodeRabbit

  • Bug Fixes

    • Fewer spurious error reports by suppressing known passkey/auth cancellation and other expected errors.
    • Improved detection of user-cancelled authentication so cancellations no longer surface as incidents.
  • Refactor

    • Centralized error classification and fingerprinting to make error reporting more consistent across the app.

@changeset-bot
Copy link

changeset-bot bot commented Feb 13, 2026

🦋 Changeset detected

Latest commit: e2620dc

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

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

Walkthrough

Centralizes error parsing/classification and fingerprinting for passkey/auth errors, integrates classification into Sentry's beforeSend to drop or fingerprint events, updates callers to use classifiers, and adds a patch changeset metadata file. (50 words)

Changes

Cohort / File(s) Summary
Release metadata
/.changeset/nrts-fppm-tpur.md
Adds a patch changeset for @exactly/mobile (metadata-only) noting fingerprinting/passkey error handling.
Sentry integration / layout
src/app/_layout.tsx
Adds a beforeSend handler that calls classifyError on event sources, drops events marked expected, and assigns event fingerprint when provided.
Error classification core
src/utils/reportError.ts
Introduces parsing/normalization and classification (message lists, flags), exports helpers (isPasskeyExpected, isPasskeyCancelled, isAuthExpected, isExpected, fingerprint, classifyError), and updates reportError to short-circuit expected errors and attach fingerprints.
Client/server callers
src/utils/accountClient.ts, src/utils/useAuth.ts, src/utils/server.ts
Replaces ad-hoc string/type checks with classifier helpers (isPasskeyCancelled, isAuthExpected, isPasskeyExpected), simplifying cancellation/suppression and server error suppression logic.

Sequence Diagram(s)

sequenceDiagram
    participant App as Application
    participant Report as reportError
    participant Classify as classifyError / parseError
    participant Sentry as Sentry (beforeSend)

    App->>Report: reportError(error, hint?)
    Report->>Classify: parseError(error)
    Classify-->>Report: {code,name,message}
    Report->>Classify: classify(parsed)
    Classify-->>Report: {expected, fingerprint, flags}

    alt expected == true
        Report-->>App: return (suppressed)
    else
        Report->>Sentry: captureException(error, hint?)
        Sentry->>Classify: classify(event sources)
        Classify-->>Sentry: {expected?, fingerprint?}
        alt event expected == true
            Sentry-->>Report: drop event
        else
            alt fingerprint present
                Sentry->>Sentry: set event.fingerprint
            end
            Sentry-->>Report: send event
        end
        Report-->>App: return
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • dieguezguille
  • franm91
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ⚠️ Unable to check for merge conflicts: Stream setup permanently failed: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically describes the main objective of the changeset: fingerprinting passkey errors by message and dropping expected errors.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch catch
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch catch
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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 significantly refactors the application's error reporting and handling mechanisms. By centralizing the classification and fingerprinting of errors, particularly those stemming from passkey and authentication processes, the changes aim to streamline error tracking. This ensures that expected or transient errors are automatically suppressed or grouped, leading to a cleaner and more actionable error reporting stream in Sentry, ultimately improving the efficiency of debugging and issue resolution.

Highlights

  • Centralized Error Classification: New utility functions were introduced in src/utils/reportError.ts to parse, classify, and fingerprint various types of errors, especially those related to passkey operations, network issues, and authentication.
  • Improved Sentry Integration: The Sentry beforeSend hook in src/app/_layout.tsx was updated to leverage the new error classification logic, allowing for automatic filtering of expected errors and consistent fingerprinting of similar issues, reducing noise in error tracking.
  • Refactored Error Handling: Existing verbose error checks and conditional logic across src/utils/accountClient.ts, src/utils/server.ts, and src/utils/useAuth.ts were replaced with calls to the new centralized utility functions, improving code readability, maintainability, and consistency.
Changelog
  • .changeset/nrts-fppm-tpur.md
    • Added a new changeset file for the patch.
  • src/app/_layout.tsx
    • Imported fingerprint and isExpected functions from reportError.
    • Added a beforeSend hook to Sentry initialization to filter out expected errors and apply custom fingerprints based on error messages.
  • src/utils/accountClient.ts
    • Imported isPasskeyCancelled from reportError.
    • Replaced a multi-line conditional check for passkey cancellation error messages with a call to isPasskeyCancelled.
  • src/utils/reportError.ts
    • Introduced new functions: isPasskeyExpected, isPasskeyCancelled, isAuthExpected, isExpected, fingerprint, parseError, classify, and normalizeMessage.
    • Updated the main reportError function to use the new classification logic to prevent reporting of expected errors and to apply custom fingerprints.
  • src/utils/server.ts
    • Imported isPasskeyExpected from reportError.
    • Replaced a complex conditional suppressError logic with a call to isPasskeyExpected.
  • src/utils/useAuth.ts
    • Imported isAuthExpected from reportError.
    • Replaced a large conditional block for expected authentication errors in handleError with a call to isAuthExpected.
    • Simplified the reportError invocation by removing explicit fingerprinting, relying on the updated reportError utility.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a centralized error classification and fingerprinting mechanism in reportError.ts, which is a great improvement for maintainability and consistency. The changes effectively refactor several parts of the application to use this new utility, simplifying the code by removing duplicated error-handling logic. My review includes a suggestion to refactor the exported helper functions to improve performance by avoiding redundant computations, and a minor style improvement to enhance code conciseness.

@sentry
Copy link

sentry bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 62.50000% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.39%. Comparing base (3ec8092) to head (e2620dc).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/utils/reportError.ts 63.15% 28 Missing ⚠️
src/utils/useAuth.ts 0.00% 3 Missing ⚠️
src/utils/accountClient.ts 0.00% 1 Missing ⚠️
src/utils/server.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #774      +/-   ##
==========================================
+ Coverage   68.15%   68.39%   +0.23%     
==========================================
  Files         207      207              
  Lines        6950     7005      +55     
  Branches     2167     2189      +22     
==========================================
+ Hits         4737     4791      +54     
- Misses       2021     2022       +1     
  Partials      192      192              
Flag Coverage Δ
e2e 68.39% <62.50%> (+16.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 5 additional findings in Devin Review.

Open in Devin Review

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ce5b6fe31

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bca2b7151

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

View 9 additional findings in Devin Review.

Open in Devin Review

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

View 10 additional findings in Devin Review.

Open in Devin Review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df7e58df15

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 11 additional findings in Devin Review.

Open in Devin Review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2620dc093

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@cruzdanilo cruzdanilo merged commit e2620dc into main Feb 13, 2026
12 of 13 checks passed
@cruzdanilo cruzdanilo deleted the catch branch February 13, 2026 21:12
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.

1 participant