Added back in favicon, and Sentry and other common headers #527
No reviewers
Labels
No labels
Kestra
bug
enhancement
someday
subtask
☁️ api
🎛️ infrastructure
🐞 sentry
📆 2025 Season
📝 pages
allpicks
📝 pages
picks
📝 pages
standings
🚀 performance
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
johnsturgeon/tgfp-web!527
Loading…
Reference in a new issue
No description provided.
Delete branch "add-common-header-to-the-new-v3-template"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves #524
The change is well-constructed and functional: favicon assets and the manifest all exist with correct
/static/...paths, thev3/base.htmltemplate is genuinely rendered byapp/routers/v3.py,configandplayerare always in context, and the user-identifying fields are correctly| tojson-escaped. My notes below are about tuning and consistency rather than correctness — none are blocking.Review: PR #527 — favicon, Sentry, and common headers
Overall this is a clean, low-risk change. The vendored Sentry bundle, favicon links, and manifest all check out (assets exist under
app/static/images/favicon/, manifest icon paths match the/staticmount, andbrowserTracingIntegrationis present in the bundled build). Thedefer+DOMContentLoadedsequencing is actually correct — the inline init runs during parse before the deferred bundle executes, so waiting forDOMContentLoadedis what makesSentryavailable. A few things are worth tightening.Worth fixing
tracesSampleRate: 1.0sends performance traces for 100% of page loads (app/templates/v3/base.html:27). Combined withbrowserTracingIntegration(), every navigation emits a transaction. CLAUDE.md notes the backend Sentry/Tank01 usage is metered-plan conscious; 100% browser tracing can burn through quota fast on a self-hosted or paid ingest. Consider a lower rate (e.g.0.1) or driving it from config so production and dev can differ.The Sentry bundle is fetched unconditionally, even when
SENTRY_DSNis unset (app/templates/v3/base.html:14). The<script defer src=".../sentry-10.74.0.min.js">tag sits outside the{% if config.SENTRY_DSN %}guard, so every environment (including local dev with no DSN) downloads ~148 KB that never gets used. Moving the<script defer>tag inside the{% if config.SENTRY_DSN %}block avoids the wasted fetch.dsn,environment, andreleaseare interpolated as raw HTML-escaped strings inside<script>(app/templates/v3/base.html:22-24), unlike the player fields just below which correctly use| tojson. HTML autoescaping does not make values safe inside a<script>element (browsers treat script content as raw text, so an escaped"would corrupt the value rather than protect it). These are operator-controlled config so the practical risk is low, but for both correctness and consistency with thesetUsercall, use| tojson, e.g.dsn: {{ config.SENTRY_DSN | tojson }}.Nits
<meta charset="utf-8">was replaced with the legacyhttp-equivform (app/templates/v3/base.html:6). Both are valid, but the HTML5 short form is the recommended, more compact declaration and there's no benefit to the downgrade — consider keeping the original.No guard if the self-hosted bundle fails to load. If
sentry-…min.js404s or is blocked, theDOMContentLoadedhandler throwsReferenceError: Sentry is not defined. Aif (window.Sentry) { … }wrapper makes init resilient.favicon.icoexists but isn't linked and isn't served at the web root. Browsers auto-request/favicon.ico, which will 404 since static is mounted at/static. The 32×32 PNG link covers most cases, so this is optional.Early-load errors (before
DOMContentLoaded) won't be captured given thedefer+DOMContentLoadedapproach. That's an accepted tradeoff of the loader pattern and the commit message shows it's intentional — flagging only for awareness.No test coverage is added, but template rendering isn't unit-tested elsewhere in this repo, so that's consistent with existing conventions.