Repository navigation
📦🔧:update the vendored analytics script - #1864
Conversation
The copy here was taken in 2024 and upstream has moved six times since. It is replaced with what `gc.zgo.at/count.js` serves today, which is byte for byte what the project has at 478f026eb9deacb9378a46b96db72e11e9f20557. One of those six matters beyond the byte count. Upstream removed the sizes table, and the script now sends the screen width alone; the copy here still sent the height and the pixel ratio with every visit, to a server with nowhere left to put them. Measured on a phone viewport, `s` went from `390,844,3` to `390`. The rest: `navigator.sendBeacon` is checked before it is called rather than assumed, two compatibility shims for versions long gone are out, a warning reads better, and a per-hit way to skip a session arrived. The file stays byte for byte upstream's, with no local edits, so telling whether it has drifted is one `diff` away. Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is> Assisted-by: Claude-Code:claude-opus-5 Refs: #1548
✅ Deploy Preview for gh-pages-openinf ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe GoatCounter script now preserves the existing global object, exposes request helpers, adds no-session fields, reduces screen data, removes the legacy endpoint fallback, and handles missing beacon APIs before using image requests. ChangesGoatCounter tracking
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized vendor refresh removes unnecessary screen-height and pixel-ratio data and adds a safe beacon fallback without changing local application code; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
The vendored copy was taken in 2024 and upstream has moved six times
since. This replaces it with what
gc.zgo.at/count.jsserves today.Provenance, established rather than assumed
10d7e6e2(2024-06-03)478f026e(2026-04-07)gc.zgo.at/count.jstodaymasterThe old copy had no local edits, so this is a clean swap with
nothing of ours to preserve. Every one of the 34 changed lines maps to
a real upstream commit:
6ebd8067b41aa43awindow.goatcounter.varsshimc8f63598window.countershim6731d117d8d8b7a9navigator.sendBeaconexists478f026eno_sessionOne of them is the reason to do this now
Upstream stopped collecting screen size beyond the width. Our copy did
not, so every visit has been sending screen height and device pixel
ratio to a server that removed the table they went in.
Measured on a phone viewport, building each version and reading what
goatcounter.url()produces:Height and pixel ratio are a fingerprinting surface, and they were
being sent for nothing.
Second most useful:
navigator.sendBeaconwas called unguarded, so anenvironment without it threw instead of falling back to the image
beacon.
Verified
mastergoatcounter.countisdefined
nps testpassesSize is near enough unchanged: 9,148 → 9,213 bytes, slightly larger.
Keeping it in sync
#1865 watches this file weekly and opens an issue when it drifts. Kept
separate because it is a mechanism rather than a version bump, and
because this diff should read as nothing but what upstream changed.
Refs #1548
Summary by CodeRabbit
navigatororsendBeaconare unavailable.