fix: error logging so server errors are actually captured in Sentry#522
Conversation
|
👋 Hotfix Branch PR Detected! Before merging this Pull Request into This will:
You can trigger the workflow from the 'Actions' tab, selecting the 'Release' workflow, and choosing this |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughThe PR improves Sentry error logging and configuration consistency by renaming environment variables from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docker-compose.yml (1)
26-33: Consider leaving the sample Sentry vars unset by default.
fdm-app/instrument.server.mjsnow treats any non-emptyPUBLIC_SENTRY_DSNas configured, soYOUR_SENTRY_DSNkeeps the compose template on the Sentry-enabled path instead of exercising the no-Sentry startup path this PR is trying to preserve. Commenting these out until real values are available would make the optional-Sentry behavior easier to validate.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docker-compose.yml` around lines 26 - 33, The docker-compose Sentry env vars (notably PUBLIC_SENTRY_DSN) are populated with placeholder strings which instrument.server.mjs treats as "configured"; remove or unset those placeholders so the app can exercise the no‑Sentry startup path. Update the docker-compose.yml by commenting out or setting to an empty value the PUBLIC_SENTRY_DSN, PUBLIC_SENTRY_ORG, PUBLIC_SENTRY_PROJECT and SENTRY_AUTH_TOKEN entries (you can leave sampling flags if desired), so instrument.server.mjs will detect no Sentry configuration and follow the optional‑Sentry behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@fdm-app/app/lib/error.ts`:
- Around line 134-137: The 5xx responses currently skip the shared reporting
path and only console.warn/return a generic message; modify the loader/action
error handling so that any error with status >= 500 is passed to reportError()
(same signature used later where errorId is created with reportError(error, {
scope: "loader" })) before constructing the response/toast, and use the returned
errorId in the response body/toast; apply the same change to the other
occurrence around the second block (the similar fallback at lines ~276-279) so
all server-side 5xx errors use consistent reporting and errorId generation.
---
Nitpick comments:
In `@docker-compose.yml`:
- Around line 26-33: The docker-compose Sentry env vars (notably
PUBLIC_SENTRY_DSN) are populated with placeholder strings which
instrument.server.mjs treats as "configured"; remove or unset those placeholders
so the app can exercise the no‑Sentry startup path. Update the
docker-compose.yml by commenting out or setting to an empty value the
PUBLIC_SENTRY_DSN, PUBLIC_SENTRY_ORG, PUBLIC_SENTRY_PROJECT and
SENTRY_AUTH_TOKEN entries (you can leave sampling flags if desired), so
instrument.server.mjs will detect no Sentry configuration and follow the
optional‑Sentry behavior.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0ed8c701-b3a9-4c0d-8397-9d95e5ce038c
📒 Files selected for processing (6)
.changeset/fix-error-logging.mddocker-compose.ymlfdm-app/app/entry.client.tsxfdm-app/app/entry.server.tsxfdm-app/app/lib/error.tsfdm-app/instrument.server.mjs
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary by CodeRabbit
Bug Fixes
Chores
Closes #521