Skip to content

🥅 name and fingerprint warning-level exceptions#811

Merged
cruzdanilo merged 3 commits intomainfrom
warn
Feb 19, 2026
Merged

🥅 name and fingerprint warning-level exceptions#811
cruzdanilo merged 3 commits intomainfrom
warn

Conversation

@cruzdanilo
Copy link
Member

@cruzdanilo cruzdanilo commented Feb 19, 2026


Open with Devin

Summary by CodeRabbit

  • Chores

    • Improved server-side error reporting to preserve meaningful error names, apply consistent warning classification, and capture richer contextual data for diagnostics.
    • Added changeset files documenting patch releases.
  • Bug Fixes

    • Standardized reporting for several warning-level events to ensure consistent fingerprints and levels.
  • Tests

    • Updated a unit test to match the new fingerprint format for NoBalance warnings.

Greptile Summary

improves sentry error reporting for warning-level exceptions by setting custom exception types and consistent fingerprints. this ensures that similar warnings are properly grouped in sentry dashboards rather than appearing as separate issues.

key changes:

  • uses withScope and addEventProcessor to set custom exception.type values instead of generic Error
  • adds explicit fingerprint arrays for each warning type (e.g., ["{{ default }}", "NoBalance"])
  • applies pattern consistently across server (card api, activity hooks, panda hooks, manteca utils) and mobile (reportError utility)
  • updates test to match new fingerprint format
  • adds fallback to raw body string in error fingerprinting when json parsing doesn't yield useful fields

improvements:

  • better sentry issue grouping for operational warnings like NoBalance, bad collection, has pending tasks, missing pax
  • more meaningful exception names in sentry instead of generic Error
  • consistent fingerprinting strategy across codebase

Confidence Score: 4/5

  • safe to merge with minor observability considerations
  • the changes improve error tracking consistency and are well-tested (includes test update). implementation follows sentry best practices using withScope to avoid mutation side effects. score reflects that while the changes are safe, they modify error reporting patterns across the codebase which requires careful verification in production.
  • no files require special attention - all changes follow consistent patterns

Important Files Changed

Filename Overview
src/utils/reportError.ts enhances error reporting to set custom exception types for warning-level errors, improving sentry grouping and fingerprinting
server/api/card.ts wraps warning-level exceptions with custom types and fingerprints for better sentry grouping (user issues, missing pax errors)
server/hooks/activity.ts updates NoBalance exception to use custom type instead of raw message for consistent sentry grouping
server/hooks/panda.ts adds custom type and fingerprint for bad collection warning to improve sentry error tracking
server/index.ts falls back to raw response body in fingerprint when json parsing fails or doesn't contain expected fields
server/utils/ramps/manteca.ts adds fingerprints and custom types for warning-level exceptions (upload failures, pending tasks)

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Warning-Level Exception Occurs] --> B{Is Exception Known?}
    B -->|Yes| C[Use withScope]
    B -->|No| D[Standard captureException]
    C --> E[Add Event Processor]
    E --> F[Set Custom Exception Type]
    F --> G[Set Fingerprint Array]
    G --> H[captureException with level: warning]
    H --> I[Sentry Groups by Type + Fingerprint]
    D --> J[Sentry Uses Default Grouping]
    
    style C fill:#ffeb99
    style F fill:#99ccff
    style G fill:#99ccff
    style I fill:#99ff99
Loading

Last reviewed commit: 34d13fb

@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2026

🦋 Changeset detected

Latest commit: 34d13fb

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

@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 improves the observability and management of warning-level exceptions across the application. By standardizing the naming and fingerprinting of these exceptions, it ensures that similar issues are grouped effectively in error monitoring systems, making it easier to identify, track, and address recurring problems. The changes involve both direct modifications to captureException calls in various server-side modules and an enhancement to a central error reporting utility to automate this process.

Highlights

  • Standardized Error Naming: Ensured that error.name is explicitly set for warning-level exceptions across various modules, improving clarity and grouping in error monitoring tools.
  • Enhanced Error Fingerprinting: Implemented custom fingerprints for warning-level exceptions, allowing for more precise grouping and analysis of similar issues.
  • Centralized Warning-Level Error Handling: Updated the reportError utility to automatically assign an error.name and fingerprint for warning-level exceptions if not already defined, reducing boilerplate and ensuring consistent reporting.
Changelog
  • .changeset/cozy-weeks-change.md
    • Added a new changeset file for @exactly/mobile to document the warning-level report changes.
  • .changeset/sharp-trees-run.md
    • Added a new changeset file for @exactly/server to document the warning-level exception changes.
  • server/api/card.ts
    • Modified decrypt function to set error.name to issue.type and add fingerprint for warning-level captureException calls.
    • Modified handlePlatinumUpgrade function to set error.name to 'missing pax' and add fingerprint for specific warning-level captureException calls.
  • server/hooks/activity.ts
    • Modified the Hono().post handler to set result.reason.name to result.reason.message for 'NoBalance()' warning-level exceptions.
  • server/hooks/panda.ts
    • Modified the Hono().post handler to explicitly create an Error object, set its name to 'bad collection', and add a fingerprint for warning-level captureException calls.
  • server/utils/ramps/manteca.ts
    • Modified uploadIdentityFile to derive error.name from the error message or a default token and add a fingerprint for warning-level exceptions during retries.
    • Modified getProvider to explicitly create an Error object, set its name to 'has pending tasks', and add a fingerprint for warning-level captureException calls.
  • src/utils/reportError.ts
    • Updated reportError to check for warning level hints or known classifications.
    • Automatically sets error.name based on fingerprint, parsed.name, parsed.status, or parsed.message if the error is a warning and error.name is generic.
    • Automatically sets a default fingerprint if the error is a warning and no custom fingerprint is provided.
Activity
  • No specific activity (comments, reviews, etc.) was provided in the context.
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.

@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Normalize Sentry exception naming and add deterministic fingerprints and warning-level handling across server error handlers and the shared reportError utility; also add two changeset files declaring patch releases for @exactly/mobile and @exactly/server. (50 words)

Changes

Cohort / File(s) Summary
Changesets
.changeset/cozy-weeks-change.md, .changeset/sharp-trees-run.md
Add two changeset files declaring patch releases with one-line notes for @exactly/mobile and @exactly/server.
Server API error handling
server/api/card.ts
Wrap Sentry captures in withScope (imported from @sentry/node), set event.exception.values[0].type from issue names or explicit strings, and add fingerprints ["{{ default }}", <type>] for captured errors.
Server hooks
server/hooks/activity.ts, server/hooks/panda.ts
Wrap warning/error captures in withScope, set explicit exception type values (e.g., "NoBalance", "bad collection"), and apply deterministic fingerprints ["{{ default }}", <type>] while preserving existing contexts.
Server utils (ramps)
server/utils/ramps/manteca.ts
Use withScope for some warning captures, add fingerprints like ["{{ default }}", "upload identity file"] or ["{{ default }}", "has pending tasks"], and include relevant contexts (e.g., mantecaUser).
Shared report utility
src/utils/reportError.ts
Parse errors once, determine warning vs. error, derive a title/fingerprint, set scope level to warning for warnings, attach fingerprints (or default based on title), and add an event processor to set the exception type for warnings before capture.
Tests
server/test/hooks/activity.test.ts
Update expected fingerprint assertion to "{{ default }}:NoBalance" (removed trailing () from expectation).

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • nfmelendez
  • dieguezguille
  • franm91
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective of the PR: adding consistent naming and fingerprinting for warning-level exceptions across the codebase.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch warn

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.

@sentry
Copy link

sentry bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 49.05660% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.20%. Comparing base (77098a5) to head (34d13fb).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
server/api/card.ts 38.88% 10 Missing and 1 partial ⚠️
src/utils/reportError.ts 52.63% 9 Missing ⚠️
server/hooks/panda.ts 0.00% 5 Missing ⚠️
server/hooks/activity.ts 80.00% 0 Missing and 1 partial ⚠️
server/utils/ramps/manteca.ts 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #811      +/-   ##
==========================================
- Coverage   69.37%   69.20%   -0.17%     
==========================================
  Files         208      208              
  Lines        7111     7147      +36     
  Branches     2256     2267      +11     
==========================================
+ Hits         4933     4946      +13     
- Misses       1992     2013      +21     
- Partials      186      188       +2     
Flag Coverage Δ
e2e 52.50% <26.41%> (-0.19%) ⬇️

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.

greptile-apps[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

gemini-code-assist[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

greptile-apps[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

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: 34d13fb65d

ℹ️ 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 34d13fb into main Feb 19, 2026
13 of 14 checks passed
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

Comments