-
Notifications
You must be signed in to change notification settings - Fork 134
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: recordings that are paused for their whole duration #1626
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1174,7 +1174,7 @@ export class SessionRecording { | |
const isBelowMinimumDuration = | ||
isNumber(minimumDuration) && isPositiveSessionDuration && sessionDuration < minimumDuration | ||
|
||
if (this.status === 'buffering' || isBelowMinimumDuration) { | ||
if (this.status === 'buffering' || this.status === 'paused' || isBelowMinimumDuration) { | ||
this.flushBufferTimer = setTimeout(() => { | ||
this._flushBuffer() | ||
}, RECORDING_BUFFER_TIMEOUT) | ||
|
@@ -1269,17 +1269,15 @@ export class SessionRecording { | |
return | ||
} | ||
|
||
// we can't flush the buffer here since someone might be starting on a blocked page, | ||
// and we need to be sure that we don't record that page | ||
// so we might not get the below custom event but events will report the paused status | ||
// which will allow debugging of sessions that start on blocked pages | ||
this._urlBlocked = true | ||
document?.body?.classList?.add('ph-no-capture') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this snuck past me in the initial implemention. naughty paul |
||
|
||
// Clear the snapshot timer since we don't want new snapshots while paused | ||
clearInterval(this._fullSnapshotTimer) | ||
|
||
// Running this in a timeout to ensure we can | ||
setTimeout(() => { | ||
this._flushBuffer() | ||
}, 100) | ||
|
||
logger.info('recording paused due to URL blocker') | ||
this._tryAddCustomEvent('recording paused', { reason: 'url blocker' }) | ||
} | ||
|
@@ -1290,7 +1288,6 @@ export class SessionRecording { | |
} | ||
|
||
this._urlBlocked = false | ||
document?.body?.classList?.remove('ph-no-capture') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the other changes make sense, this one does not feel related to the original issue? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, it's totally fly-by, commented on above. i don't think we should be doing that |
||
|
||
this._tryTakeFullSnapshot() | ||
this._scheduleFullSnapshot() | ||
|
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.
that means that flushing before pausing is no longer safe.
really we should detect if we've ever flushed and then flush or not based on that but it's better to avoid this completely