fix: Harden production analytics behavior - #5
Merged
Merged
Conversation
Preserve allowed pageviews while filtering private routes. Verify deployed analytics surfaces independently and package the license with the public client. Co-authored-by: Codex <noreply@openai.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.
TL;DR
Hardens the first public analytics package before
0.1.0is published. Private routes no longer disable valid pageviews elsewhere in an SPA, clean browsers withoutsendBeaconuse the documented fetch fallback, and production verification distinguishes Cloudflare's script, RUM requests, and LVBT collector traffic.Overview of Changes
The client filters pageviews per route while preserving automatic SPA tracking on allowed paths. It also restores patched browser APIs during tests and handles environments where
navigator.sendBeaconis absent.The verification command now checks the configured site and separates script loading, Cloudflare RUM, and collector events. Weekly coverage includes every configured production property. The package tarball includes the repository's MIT license.
pnpm checkpasses with 49 package unit tests, 15 collector tests, 2 report tests, 3 Playwright tests, package validation, size checks, and Wrangler dry runs.Follow-ups
Publish
@lvbt/analytics@0.1.0after this review merges, then replace the verified local tarball in Labs, the main website, and TransitMapper with the registry release.