Conversation
Only the Rails side reported to Sentry, so frontend failures such as the Elm plan app crashing after a language switch never showed up anywhere. Load @sentry/browser from the application bundle and configure it from meta tags that are rendered only where the Ruby SDK is enabled. Events carry the environment, release, user id and organization id, are limited to our own scripts, and are capped per page load so a render loop cannot flood the project. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
allowUrls lets through errors without a usable filename and anything thrown from inline third-party snippets on our own origin. Require the frame that threw to be one of our /assets/ bundles instead, and ignore network failures and aborted requests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The DSN is rendered into every page. Only use the frontend project's, which is limited to our origins and rate limited. Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Why
Sentry only covered the Rails side. The Plan crash after switching language (#468) threw hundreds of errors in the browser, and nobody would have known without checking the console.
What
@sentry/browseris initialised first inapplication.js(app/javascript/src/sentry.js). It catches uncaught errors and unhandled rejections, including errors thrown fromrequestAnimationFramecallbacks, where Elm renders.SentryHelper#sentry_meta_tagsrenders the configuration inbaseanderrorlayouts, but only where the Ruby SDK is enabled (production and staging), so development and test send nothing.SENTRY_FRONTEND_DSN, with no fallback toSENTRY_KEY: it's rendered into every page, so the backend DSN must never end up there. It points to the Sentry projectstemplin-frontend(id 32), which is limited to*.stemplin.comorigins and rate limited. It has the same alert rules asstemplinand the browser-extension, legacy-browser and web-crawler filters turned on. The variable is already set on Dokku./assets/(application-*.js,plan-*.js). That drops browser extensions, inline third-party snippets (gtag, Clarity, PostHog, AOS) and errors without a stack. Sentry's own timer wrappers don't count, because only the innermost frame is checked.Failed to fetch,NetworkError,Load failed,…aborted…) are ignored. So are Sentry's default filters (ResizeObserver,Script error.).window.onerror.config.releaseis set from Dokku'sGIT_REVso backend and frontend events share a release.Verified
SENTRY_FRONTEND_DSNis missing, and the full set of tags is rendered when it's set.connect. Inline errors were all dropped: timer,requestAnimationFrame, event listener, promise rejection, and failed fetch.After merging
deployrun to go green before merging anything else. A second merge during a deploy hits Dokku's deploy lock and silently skips that deploy, which is what happened to Fix Plan breaking after switching language #468.<meta name="sentry-dsn">, and the first real browser error should show up instemplin-frontend.Not included
application.jsisn't minified, so stack traces are readable.plan.jsis minified by the Elm build, and uploading maps would needsentry-cliand an auth token in the Docker build.🤖 Generated with Claude Code