Skip to content

Harden front end: stale-chunk reload, Sentry noise filtering, floating-promise guard - #31

Merged
amrtgaber merged 1 commit into
mainfrom
fix/launch-hardening
Jun 28, 2026
Merged

Harden front end: stale-chunk reload, Sentry noise filtering, floating-promise guard#31
amrtgaber merged 1 commit into
mainfrom
fix/launch-hardening

Conversation

@amrtgaber

Copy link
Copy Markdown
Contributor

Closes #30.

Applies the front-end production-hardening lessons from the aoe2-live-standings-api launch audit.

Changes

  • Stale code-split chunkssrc/main.tsx adds a vite:preloadError listener that surfaces a one-shot "new version available" toast (sonner, already mounted in __root.tsx) with a Reload action. Prompt rather than force-reload: the router uses defaultPreload: "intent", so the event fires on hover, and a forced reload would discard unsaved work.
  • Sentry noisesrc/lib/sentry.ts adds beforeSend + ignoreErrors/denyUrls to drop never-actionable noise (intentional AbortError cancellation, browser extensions, translating proxies, sandboxed-storage errors) so it doesn't bury real errors or burn quota.
  • Floating promisesrc/lib/auth.tsx guards the fire-and-forget checkAuth() with a .catch that reports to Sentry. It already catches internally; this prevents a future refactor from leaking an unhandled rejection.

Test plan

  • pnpm lint — pass (pre-existing react-refresh warnings only)
  • pnpm format:check — pass
  • pnpm tsc --noEmit — pass
  • pnpm test:run — 7 passed
  • pnpm build — succeeds

…romise

- main.tsx: add a `vite:preloadError` listener that prompts a one-shot "new
  version available" toast (sonner) when a deploy replaces a chunk an open tab is
  importing. Prompt rather than force-reload — `defaultPreload: "intent"` fires
  the event on hover, and a forced reload would discard unsaved work.
- lib/sentry.ts: add `beforeSend` + `ignoreErrors`/`denyUrls` to drop
  never-actionable noise (intentional AbortError cancellation, browser
  extensions, translating proxies, sandboxed storage) so it doesn't bury real
  errors or burn quota.
- lib/auth.tsx: guard the fire-and-forget `checkAuth()` with `.catch` reporting
  to Sentry (it already catches internally; this prevents a future refactor from
  leaking an unhandled rejection).
@netlify

netlify Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploy Preview for criticalbit-web ready!

Name Link
🔨 Latest commit 6529e43
🔍 Latest deploy log https://app.netlify.com/projects/criticalbit-web/deploys/6a41b29e987a06000823671e
😎 Deploy Preview https://deploy-preview-31--criticalbit-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@amrtgaber
amrtgaber merged commit 244c65e into main Jun 28, 2026
6 checks passed
@amrtgaber
amrtgaber deleted the fix/launch-hardening branch June 28, 2026 23:48
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.

Production hardening: apply live-event launch lessons

1 participant