Repository navigation
fix(analytics): switch session replay off for every visitor - #701
Merged
Merged
Conversation
The layout loaded the Umami recorder (session replay and heatmaps) for every visitor who had not opted out, without consent. The analytics standard allows replay only with consent (Tier 2), and the site has no consent UI yet. No page loads the recorder now. Cookieless Umami page counting stays. - layout.jsx renders only /stats.js; RecorderScript and its test go. - /legal says replay is off; its "last updated" date moves to December 2026. - The /recorder.js relay and the recorder rewrites stay for the consent work (phase 3 of the unified privacy design). Refs #617 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tab that loaded the recorder before the deploy kept posting replay data through the /api/record rewrite until its version reload, and a tab without localStorage never reloads. Nothing on the site needs the relay now, so /recorder.js, /api/record and /api/websites/:id/recorder go. The consent work can restore them from git. Docs (/docs/infrastructure, .planning/codebase, the API architecture note) and the changelog line follow. Refs #617 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/legal said the terminal "records no visits", which reads as if page counting stopped too. It now says it creates no session recordings. The opt-out confirmation said it applies "from the next page load". That delay existed only because a running recorder could not be stopped. The tracker checks the flag before each send, so the opt-out now acts at once. Refs #617 Co-Authored-By: Claude Opus 5.5 <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.
Refs #617
Phase 1 stopgap of the unified privacy design: session replay is off for every visitor. Cookieless Umami page counting stays. No consent UI. PR #654 (
feat/night-privacy-consent) is untouched; it is reworked against the design later.What changed
src/app/layout.jsxrenders only the Umami tracker (/stats.js).RecorderScript(session replay and click/scroll heatmaps) and its test are deleted./recorder.jsroute and its test, the/api/recordand/api/websites/:id/recorderrewrites, and therecorder\.jsentry in the page Cache-Control rule (next.config.mjs). A tab that loaded the recorder before the deploy now gets 404 on upload, so it cannot send data until its version reload. The consent work can restore the relay from git./legal, "Session Recording Protocols": says replay is off, the terminal creates no session recordings and no heatmaps, and earlier recordings fall under Data Retention Protocols. "Last updated" moves to December 2026, as the page's Amendments clause promises. No other legal text changes./legalopt-out confirmation now reads "Opted out. This browser now transmits no analytics." The old "from the next page load" was there only because a running recorder could not be stopped. The Umami tracker readsumami.disabledbefore each send (checked in the production/stats.js)./docs/infrastructure(analytics proxy, env table, cache table),.planning/codebase/STACK.md,.planning/codebase/INTEGRATIONS.md,.planning/architecture/helldivers-bot-api.md, theAnalyticsOptOutandproxyUmamiScriptJSDoc, and aCHANGELOG.mdline under Unreleased → Fixed.Not in this PR:
UserSection.jsxstill callsumami.identify(userId, { provider })for signed-in users. The analytics standard puts identity in Tier 2 (consent required). With replay off, it no longer links recordings to an account, but it still links page views to one.Checks (on
e094cc10)npm run lintdom-no-dangerously-set-innerhtmlinlayout.jsx, also ondevelop)npm run typechecknpm run test:unitnpm run buildPOSTGRES_URL,UPDATE_KEY,UPDATE_INTERVAL, and a dummyUMAMI_SITE_ID, so the production analytics branch renders).next/staticfiles that namerecorder.js: 0.public/sw.jsmentions ofrecorder: 0..next/routes-manifest.jsonrewrites: only/api/sendRuntime checks on
f3cf758d(the last code change;e094cc10changes text only), built app with a throwaway Postgres:/,/legal,/archives,/docs: HTTP 200,/stats.jspresent, norecorder.jsorapi/recordGET /recorder.js,GET /api/record,POST /api/record,GET /api/websites/x/recorder: all 404/and/legal:/stats.jsrequested once, no recorder script, recorder config or/api/recordhelldivers.bot/legal(currentmain)/recorder.js,/api/websites/<id>/recorderand two/api/recordpostsPersonal data
Personal data:
gdpr:art-6:para-1:pt-a(replay has no consent basis yet, so it stops),gdpr:art-5:para-1:pt-c(data minimisation),gdpr:art-5:para-1:pt-aandgdpr:art-13:para-1:pt-c(the/legalnotice states the processing as it is). Each was read withget_clause(GDPR 2026.2) and supports the change. DPOLens has no ePrivacy pack, so Art. 10/2 WVP (consent to read from or store on the device) was not checked through DPOLens.Reaching production
develop(rebase).develop, then the release PRdevelop→mainand avX.Y.Ztag. The tag builds the production image; Arcane Git Sync rolls it out.Until the release, production keeps recording. Switching replay and heatmaps off for the site in the Umami admin stops it at once: the recorder fetches its config from Umami before it records. Recordings made so far stay in Umami with no expiry until they are deleted there. Staging shows no difference: it loads no Umami scripts at all.
Council review
/api/record(P1/P2) and the relay kept "for later" (P3), inf3cf758d. The/legalwording and the opt-out confirmation (2 P2), ine094cc10.exportonreadOptOut(its test imports it). A pin test for "no recorder" (the consent work re-adds it on purpose). Inline theproxyUmamiScriptparameter (smaller diff to keep it).Verdict: approved at e094cc1
🤖 Generated with Claude Code