-
Notifications
You must be signed in to change notification settings - Fork 127
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: infinite loop when combining controls #1569
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
if (this._urlBlocked) { | ||
return 'paused' | ||
} |
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.
the fix is to have this as the (almost) earliest check in status
rrweb continues to emit, because it doesn't know that it is paused
and we continue to check
until the URL changes and we resume
@@ -501,13 +501,15 @@ export class SessionRecording { | |||
if (isNullish(this._removePageViewCaptureHook)) { | |||
// :TRICKY: rrweb does not capture navigation within SPA-s, so hook into our $pageview events to get access to all events. | |||
// Dropping the initial event is fine (it's always captured by rrweb). | |||
this._removePageViewCaptureHook = this.instance._addCaptureHook((eventName) => { | |||
this._removePageViewCaptureHook = this.instance.on('eventCaptured', (event) => { |
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.
changed this to not rely on a semi private method
const href = event?.properties.$current_url | ||
? this._maskUrl(event?.properties.$current_url) | ||
: '' | ||
if (!href || this.status !== 'active') { |
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.
pageview already tells you what URL it is, so we don't need to ask the window
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.
fly by change that had been annoying me
Size Change: +662 B (+0.02%) Total Size: 3.18 MB
ℹ️ View Unchanged
|
see https://posthoghelp.zendesk.com/agent/tickets/21246
When waiting for a linked flag to activate recordings, and also pausing on URL, the browser could get stuck in a loop trying to emit a custom event that it had paused when it had not yet started,
so the note it emitted triggered the pause check which again tried to pause
which caused a custom event
etc