OSS publish polish: server hardening, observability, client measurement fixes#2
Merged
Conversation
- Same-path 500ms dedup window collapses framework replaceState spam and rapid double-fires on the same URL. - Skip the initial pageview while document.prerendering is true; fire on prerenderingchange so speculation-rules prerender doesn't inflate views for URLs the user never lands on. - Global singleton flag warns and disables a second Analytics instance on the same page (snippet pasted twice, SPA hot-reload re-eval).
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.
Summary
Pre-publish hardening pass across server, CI, and client. Branch is the consolidation of the OSS-readiness work tracked in TOMORROW.md.
Server
/collectinput validation; ignore inert sqlx-mysql RUSTSEC advisory./metricsendpoint for production observability.CI / docs
cargo auditjob (with documented--ignore RUSTSEC-2023-0071for the rsa transitive that never links).deploy/gen-dashboard-creds.shto generate argon2id admin creds + session secret.Client (measurement quality)
replaceStatespam.document.prerendering; fire onprerenderingchangeso speculation-rules prerender does not inflate counts for URLs the user never lands on.Analyticsinstance on the same page (duplicated snippet, SPA hot-reload).Test plan
cd client && npm run build && npm test(49/49 passing)new Analytics()warns and stays inert.replaceStateto same path twice within 500ms — only one pageview emitted.