Skip to content

Stop reporting transient RevenueCat network errors to Sentry#87

Merged
Patchalv merged 1 commit into
mainfrom
fix/revenuecat-network-error-noise
Jul 16, 2026
Merged

Stop reporting transient RevenueCat network errors to Sentry#87
Patchalv merged 1 commit into
mainfrom
fix/revenuecat-network-error-noise

Conversation

@Patchalv

Copy link
Copy Markdown
Owner

Summary

Sentry issues MAPVAULT-G and MAPVAULT-H turned out to be the same root cause surfacing at two call sites in hooks/use-revenuecat.ts: transient client-side network/DNS failures during Purchases.logIn() and Purchases.getOfferings() being unconditionally reported to Sentry as errors, even though they're device connectivity blips, not app bugs.

  • Adds a shared isRevenueCatNetworkError() helper (lib/revenuecat.ts) that checks RC's own PURCHASES_ERROR_CODE.NETWORK_ERROR / OFFLINE_CONNECTION_ERROR codes, rather than string-matching the error message.
  • Both capture sites (revenuecat_login, rc_offerings) now skip Sentry for network errors, while preserving visibility via PostHog (revenuecat_login_network_error event; paywall_offerings_load_failed gains a 'network' reason).
  • revenuecat_login's remaining Sentry.captureException now attaches extra: { userId }, for parity with the sibling rc_offerings capture.
  • Updates the AnalyticsEvents type and docs/analytics.md event catalog accordingly.

Full root-cause writeup and design rationale in the session's plan; reviewed by an independent code-reviewer subagent (verdict: ready to merge, no Critical/Important issues — see PR discussion for follow-up items filed separately).

Fixes MAPVAULT-G
Fixes MAPVAULT-H

Test plan

  • npm run typecheck passes
  • npm run lint passes
  • npm run check:i18n passes
  • Code review (subagent) — no Critical/Important issues found
  • Manual on-device verification isn't practical without forcing a native DNS failure; change is a conditional branch mirroring the existing "already in progress" filter pattern already in this file

🤖 Generated with Claude Code

RC login (Purchases.logIn) and offerings (Purchases.getOfferings) both
report to Sentry unconditionally on failure, including transient
device-side network/DNS blips that aren't actionable app bugs. Filter
those out by RC's own error code instead of message-string matching,
and preserve visibility via PostHog instead of paging Sentry.

Fixes MAPVAULT-G
Fixes MAPVAULT-H

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Patchalv, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d0a2ac3c-0398-4efd-be39-1b1909f9dbde

📥 Commits

Reviewing files that changed from the base of the PR and between 7b354e9 and 816c066.

📒 Files selected for processing (4)
  • docs/analytics.md
  • hooks/use-revenuecat.ts
  • lib/analytics.ts
  • lib/revenuecat.ts

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.

@Patchalv Patchalv self-assigned this Jul 16, 2026
@Patchalv
Patchalv merged commit 1cbdd9b into main Jul 16, 2026
2 checks passed
@Patchalv
Patchalv deleted the fix/revenuecat-network-error-noise branch July 16, 2026 10:38
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