PostHog/posthog-js

$snapshot events being sent when session recordings are disabled

neilkakkar opened this issue · 2 comments

When disable_session_recording on the client is set to true, events are still sent to POST /e and POST /sessionRecording.

Unclear why this happens, since we have a Cypress test testing for it, which passes.

Narrowed down to: https://github.com/PostHog/posthog-js/blob/master/src/extensions/sessionrecording.js#L39-L40 - L39 has a check for the flag, and emit=true should ensure this.snapshots aren't populated, but seems like L40 still gets them, and thus sends the events to the endpoint.

This should be fixed in 1.10.2

@mariusandra Great, thank you!