Stu Mason
Stu Mason

Activity

StuMason/cleanconnect
TidyLinker.com
TypeScript
Pull Request Opened

PR #171 opened: chore: bind frontend Sentry release tag end-to-end

Why

PR #167 wired sourcemap upload but missed the binding piece: every event Sentry receives currently has release: None. That means even once SENTRY_AUTH_TOKEN (now set on Coolify) starts uploading maps with the next build, Sentry won't be able to associate them with events. Stack traces in the UI stay as Qc, e.startTransition, r.onerror — useless for debugging the three live frontend issues (TIDY-LINKER-3Q login insertBefore, 3N FormData on /, 3C HttpNetworkError on update-rates).

This wires the release tag end-to-end.

Changes

  • vite.config.ts — compute a release name from Coolify's auto-injected SOURCE_COMMIT at build time (falls back to dev for local builds). Pass it to:
    • the Sentry Vite plugin's release.name (binds uploaded artifacts to the release)
    • a define() (so the runtime SDK init reads the exact same string)
  • resources/js/sentry.ts — read __SENTRY_RELEASE__ from the define and pass to Sentry.init.

After deploy, events will arrive tagged as tidylinker@<short-sha> and the matching uploaded sourcemaps will resolve frame names.

Backend Sentry

Intentionally NOT wiring SENTRY_RELEASE for the Laravel SDK in this PR. PHP stack traces aren't minified — they already give us real file paths and line numbers. We can revisit if backend release tagging starts paying off (better deploy-vs-error correlation, etc.).

Coolify state (already done)

  • SENTRY_API_TOKEN set as build-time env var on the prod app (hcow00oos8cwcsscc08okckk). Uses the same user token from local .env — has project:releases scope.
  • SOURCE_COMMIT is auto-injected by Coolify, no config needed.

Test plan

  • npm run build with SOURCE_COMMIT=abc123def456 → release string tidylinker@abc123def456 baked into bundle (grep -o 'tidylinker@...' public/build/assets/app-*.js)
  • npm run build without token → 0 .map files emitted (PR #167's regression guard still holds)
  • npm run build with token → upload step runs, maps deleted post-upload
  • eslint clean, no new TS errors
  • Manual: after merge + deploy, check a fresh Sentry event has release: tidylinker@<sha>
  • Manual: trigger one of the live errors (or wait for one), confirm Sentry now resolves to real file names in the stack
+20
additions
-0
deletions
2
files changed