-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: continue recording after reset #1135
Conversation
Size Change: +600 B (0%) Total Size: 951 kB
ℹ️ View Unchanged
|
cy.posthog().then((ph) => { | ||
ph.reset() | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's alter that ensure
or duplicate it so we can test for any snapshots maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Changes
Addresses https://posthog.com/questions/session-recordings-not-being-resumed-after-calling-posthog-restart
Because we rely on the
decide
response to know whether session recording is enabled, we assume a falsey value when the persistent storage is cleared as part of thereset
call.This change sets up a listener
onSessionId
rotation that will re-establish the keys returned by the decide response. We need to re-register all keys otherwise things like the minimum session duration would not be available for the new session.The sampling decision for the new session is handled separately in the
_samplingSessionListener
Checklist