Skip to content

Add App Router error boundaries, Sentry monitoring, and PII scrubbing… - #119

Open
Victorjonah-prog wants to merge 3 commits into
Deen-Bridge:devfrom
Victorjonah-prog:fix/issue-109-error-monitoring
Open

Add App Router error boundaries, Sentry monitoring, and PII scrubbing…#119
Victorjonah-prog wants to merge 3 commits into
Deen-Bridge:devfrom
Victorjonah-prog:fix/issue-109-error-monitoring

Conversation

@Victorjonah-prog

@Victorjonah-prog Victorjonah-prog commented Jul 22, 2026

Copy link
Copy Markdown

… (closes #109)

Summary by CodeRabbit

  • New Features
    • Added Sentry error monitoring across browser, server, and edge environments (including browser route-transition capture).
    • Added dedicated error screens for dashboard, courses, and library, with “Try again/Retry/Reload” actions and visible report IDs.
    • Added Sentry telemetry for handled Stellar payment and donation failures.
  • Bug Fixes
    • Improved Sentry privacy by redacting sensitive headers/cookies/emails from event payloads.
    • Removed the in-app auth debug log panel.
  • Configuration
    • Updated environment template and CI to support optional Sentry setup without impacting local or forked builds.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7180161f-e0f6-4b44-aa13-8ed120d00000

📥 Commits

Reviewing files that changed from the base of the PR and between ec2af96 and fb23912.

📒 Files selected for processing (2)
  • hooks/useStellarDonation.js
  • sentry.shared.config.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • hooks/useStellarDonation.js
  • sentry.shared.config.js

Walkthrough

Adds Sentry monitoring across client, server, and edge runtimes; introduces PII scrubbing and optional source-map uploads; adds App Router error boundaries; captures payment failures; and removes sensitive debug logging.

Changes

Sentry monitoring

Layer / File(s) Summary
PII scrubbing contracts
sentry.shared.config.js
Adds request, breadcrumb, URL, header, extra-data, message, user sanitization, and noisy-event filtering.
Runtime and build integration
package.json, instrumentation*.js, sentry.*.config.js, next.config.mjs, .env.example, .github/workflows/ci.yml
Initializes Sentry across runtimes and configures optional CI source-map uploads using environment variables.
Error boundaries and capture coverage
app/*error.jsx, app/dashboard/**/error.jsx, hooks/useStellar*.js
Adds recovery UIs with Sentry report IDs and captures terminal payment and donation failures while preserving toast handling.
Diagnostic cleanup
components/DebugAuthLogs.jsx, hooks/useAuth.js, lib/config/*.js
Removes the debug authentication panel and suppresses token, user, and production API URL logging.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

  • Deen-Bridge/dnb-frontend issue 74 — Removes token logging from lib/config/req.header.config.js, directly overlapping the credential-logging objective.

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant AppRouter
  participant DashboardError
  participant Sentry
  participant sentryBeforeSend
  AppRouter->>DashboardError: provide error and reset
  DashboardError->>Sentry: captureException(error)
  Sentry->>sentryBeforeSend: sanitize captured event
  sentryBeforeSend-->>Sentry: return event or null
  DashboardError-->>AppRouter: render Report ID and Try again
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change set: App Router error boundaries plus Sentry and PII-scrubbing work.
Linked Issues check ✅ Passed Issue #109's requirements are covered: error boundaries, Sentry setup, source maps, PII scrubbing, log cleanup, and failure capture are implemented.
Out of Scope Changes check ✅ Passed No obvious unrelated changes are present; the diff stays focused on error handling, Sentry, source maps, and logging cleanup.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@hooks/useStellarDonation.js`:
- Around line 102-107: Update the Sentry.captureException call in
useStellarDonation so its feature tag uses "stellar-donation" instead of
"stellar-payment", allowing donation failures to be distinguished in Sentry
queries and alerts.

In `@sentry.shared.config.js`:
- Around line 84-96: Update sentry.shared.config.js:84-96 in scrubExtra to
recursively scrub nested objects and arrays, including string values, while
continuing to remove sensitive cookie keys at every relevant object level.
Update sentry.shared.config.js:140-147 in sentryBeforeSendTransaction to pass
transaction extras through scrubExtra, matching the error-event PII handling;
both sites require changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 63746c7d-2b65-4909-81dc-46cb3cb4da2b

📥 Commits

Reviewing files that changed from the base of the PR and between 37c25df and 81386ae.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (20)
  • .env.example
  • .github/workflows/ci.yml
  • app/dashboard/courses/error.jsx
  • app/dashboard/error.jsx
  • app/dashboard/library/error.jsx
  • app/error.jsx
  • app/global-error.jsx
  • components/DebugAuthLogs.jsx
  • hooks/useAuth.js
  • hooks/useStellarDonation.js
  • hooks/useStellarPayment.js
  • instrumentation-client.js
  • instrumentation.js
  • lib/config/axios.config.js
  • lib/config/req.header.config.js
  • next.config.mjs
  • package.json
  • sentry.edge.config.js
  • sentry.server.config.js
  • sentry.shared.config.js
💤 Files with no reviewable changes (3)
  • lib/config/req.header.config.js
  • components/DebugAuthLogs.jsx
  • hooks/useAuth.js

Comment thread hooks/useStellarDonation.js
Comment thread sentry.shared.config.js
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

@Victorjonah-prog is attempting to deploy a commit to the Deen Bridge Team on Vercel.

A member of the Team first needs to authorize it.

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