TidyLinker.com
TypeScript
Pull Request Opened
PR #150 opened: fix: make Sentry useful — user context, noise filters, stale-chunk reloads
Summary
Triaging the 10 unresolved Sentry issues on dev.tidylinker.com surfaced three gaps in the existing setup; this PR addresses them together.
Backend — config/sentry.php
- Default
send_default_pii→true. The Sentry LaravelIntegration uses this to attach the authenticated user (id, email) to every event. Previously every event reporteduserCount: 0, even on authenticated admin routes, which made triage harder than it needed to be.
Frontend — resources/js/sentry.ts
- Add
ignoreErrorsfor known noise: extensionruntime.sendMessage, the benignResizeObserver loopnotification, dynamic-import failures (now recovered client-side, see below), unactionableNetworkError/Load failed. - Add
denyUrlsforchrome-extension:///moz-extension:///safari-extension://so frames from browser-injected scripts stop reaching us. Saves event quota and noise. - Export
setSentryUserhelper that maps Inertia'sauth.usershape (id,email,name) into the Sentry user scope.
Frontend — resources/js/app.tsx
- Call
setSentryUseron first paint fromprops.initialPage.props.auth.user, then again on everyrouter.on('navigate')event so login/logout flips Sentry's user scope without a hard reload. - Window-level handler for stale chunk errors after deploys:
Failed to fetch dynamically imported module/Importing a module script failed/ChunkLoadError. Reload once (sessionStorage-guarded to avoid loops) instead of leaving users staring at a broken page. AddressesTIDY-LINKER-2VandTIDY-LINKER-2Qon Sentry.
Test plan
-
php artisan test tests/Feature/Config/SentryTest.php→ 2 passed - Pint, Prettier, ESLint clean (pre-commit hook)
- After merge + deploy: confirm a new error in Sentry shows the authenticated user
- Manual: deploy, keep an old tab open, trigger a navigation that lazy-loads a chunk — observe the page auto-reload instead of erroring
- Side-channel (will do separately): bulk-resolve the 9 stale issues (#36, #32, #3A, #2V, #39, #37, #2S, #2Q, #38, #3B) in the Sentry UI; they're all already fixed by prior PRs (#142, #144) or now handled client-side
+192
additions
-7
deletions
6
files changed