-
Notifications
You must be signed in to change notification settings - Fork 123
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
Multiple Session Recording warnings when disable_session_recording = true #1378
Comments
hey @vonBrax just updating you that there's some CI fixing happening in our end-to-end tests and I'm out of the office till tuesday so I think it will be tuesday before the fix is merged sorry, we're normally faster than that) |
Hey @pauldambra, no worries. Thank you for the update and for the quick fix here! |
This should be resolved in 1.158.1 Do let us know if not! |
I can confirm that the issue is fixed in 1.158.1. Thank you @pauldambra ! |
Great news, thanks for the detailed report @vonBrax 🙌 |
Bug description
When initializing posthog with
disable_session_recording: true
, after a few interactions with the app, at some point some warnings start showing in the console:Even though no api calls are made, which seems to be respecting the
disable_session_recording
property, the presence of this logs may induce the customer to think that their session is being recorded and that our application is violating their privacy settings.The problem seems to be happening because the SessionRecorder constructor is called and immediatelly starts listening to some browsers events:
posthog-js/src/extensions/replay/sessionrecording.ts
Lines 247 to 264 in 9c8fe0e
I'm assuming that then the events are added to a queue, which also seems to have a limit of 5 entries, and if the entries can't be processed - probably because session recording should be disabled -, then the warnings start showing up.
Additional info
We are using the bundled version of posthog as described in the docs, which means that the session-recorder module is not lazy-loaded by posthog, and seems to be instantiated regardless of the posthog init config.
Steps to reproduce
disable_session_recording: true
visibilitychange
event 5 times (for example switching to a different tab or ALT+TAB to a different running application)visibilitychange
event will cause a SessionRecording warning to be displayed in the browser consoleThe text was updated successfully, but these errors were encountered: