Repository navigation
fix(browser): Refresh identity on bfcache restore - #5427
Open
posthog[bot] wants to merge 2 commits into
Open
posthog[bot] wants to merge 2 commits into
posthog[bot] wants to merge 2 commits into
Conversation
Generated-By: PostHog Desktop Task-Id: dd368b5c-40fc-49ac-9fc0-4c3c321bfb36
Contributor
Contributor
Coherence4 spec problems · 0 failing chokepoints · 2 spec gaps · 0 guard failures 44 components, 7 bullets (5 invariants, 2 requirements), 4 problems Spec problems (spec --check)
Chokepoints: none declared. Spec gaps: 2 entrances with outside or unknown trust and no traced control, and 10 more held by the adoption baseline
Close one with |
Contributor
|
Size Change: +6.12 kB (+0.02%) Total Size: 25.2 MB 📦 View Changed
ℹ️ View Unchanged
|
Contributor
posthog-js Compliance ReportDate: 2026-10-25 14:02:33 UTC ✅ All Tests Passed!26/26 tests passed Capture Tests✅ 26/26 tests passed View Details
|
Generated-By: PostHog Desktop Task-Id: dd368b5c-40fc-49ac-9fc0-4c3c321bfb36
This branch has not been deployed
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.
Problem
Why: A page restored from the back/forward cache can capture events with an old identity and a current session ID, splitting one session across people. This affects attribution and event history. Closes #5319.
Origin
f93160dChanges
The relevant persistent-storage SDK spec has no browser bfcache restore rule; this change preserves its identity restoration behavior.
Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Codex in PostHog Desktop used the Inbox report, repository code, SDK spec, and focused regression tests to implement this fix. The browser build, production typecheck, full browser unit suite, functional tests, and Chromium compatibility matrix passed. Firefox and WebKit compatibility checks could not launch because this host lacks their system libraries.
Created with PostHog Desktop from an inbox report