Repository navigation
feat: report errors to Sentry - #329
Merged
Merged
Conversation
Sentry has not sent anything since 2020, when Sentry.init was removed. - Load @sentry/angular after sign-in, so it is not in the initial bundle. Errors from before it loads are queued. - Read the DSN from the authority config.backoffice.sentry_dsn, with the PlaceOS default. '' or false turns it off. - Send errors, 10% of traces and replays of sessions with an error. Send only the user ID. - Upload hidden source maps in CI when the SENTRY_* secrets are set, and update the service worker hashes after debug IDs are injected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Deployment failed for project backoffice with the following error: Learn More: https://vercel.com/placeos?upgradeToPro=build-rate-limit |
[High impact] The reviewed update appears safe to merge; it fixes the hidden startup warning without introducing a new issue. SummaryRestores Sentry error reporting after sign-in, with domain settings, queued errors, traces, and masked replays.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backoffice has sent nothing to Sentry since 2020. That year a cleanup removed
Sentry.initand theErrorHandlerprovider. Only an unused@sentry/browserdependency was left.Changes
src/app/common/sentry.tsloads@sentry/angularwith a dynamic import after the user signs in, so the initial bundle stays small.SentryReportingErrorHandlerstill logs to the console. It queues up to 20 errors until Sentry starts.config.backoffice.sentry_dsn. When that is not set, the PlaceOS default DSN is used.''orfalseturns Sentry off. Sentry is also off on localhost and in mock mode.domaintag are sent. The old code also sent the email address.config/ngsw-rehash.jsupdates the hashes inngsw.json. Without this, the service worker rejects those files.Setup
Add the
SENTRY_AUTH_TOKEN,SENTRY_ORGandSENTRY_PROJECTrepository secrets. Until all three are set, the upload step is skipped. Seedocs/sentry.mdfor where to find each value.Testing
sentry.spec.ts. Lint and type checks pass.sentry-cli sourcemaps inject,ngsw-rehash.jsgives the same hashes as Angular'sngsw-config. On a fresh build it changes nothing.The Sentry chunk is about 120 kB gzip and loads after sign-in. Most of it is replay.
Reviewed with sol-loop: 2 rounds with gpt-6.1-sol on xhigh.
Made by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, running in T3 Code.🤖 Generated with Claude Code