-
Notifications
You must be signed in to change notification settings - Fork 140
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: never send when not sampled #1706
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
This PR modifies session recording behavior to prevent unnecessary data collection when sampling indicates a session should not be recorded, even if event/URL triggers are defined.
- Modified
/src/extensions/replay/sessionrecording.ts
to prioritize sampling status over trigger states in recording decisions - Added test case in
/src/__tests__/extensions/replay/sessionrecording.test.ts
to verify recording is disabled when sampling rate is 0 - Fixes issue where trigger pending status could override sampling decisions, leading to unwanted data collection
- Ensures recording buffer is not built up when session is explicitly not sampled
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
Size Change: +310 B (+0.01%) Total Size: 3.28 MB
ℹ️ View Unchanged
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
see: https://posthoghelp.zendesk.com/agent/tickets/24373
If a sampling decision has been made and a session should not be recorded
but event or URL triggers are defined
the trigger pending status takes precedence and we build up a buffer
when the trigger is seen we send that buffer
and then the sampling status can assert itself and the recording immediately stops
this lifts the check for
sampled is False
higher in the status check to avoid this happening