Skip to content
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

feat: start session recording on url trigger #1451

Merged
merged 14 commits into from
Oct 17, 2024
Prev Previous commit
Next Next commit
fix: use trigger statuses correctly
Richard Borcsik committed Oct 14, 2024
commit e0a2e8274ad9b992b851d8bd5466a101611a731c
8 changes: 4 additions & 4 deletions src/extensions/replay/sessionrecording.ts
Original file line number Diff line number Diff line change
@@ -265,7 +265,7 @@ export class SessionRecording {
}

private get fullSnapshotIntervalMillis(): number {
if (this.urlTriggerStatus === 'pending') {
if (this.urlTriggerStatus === 'trigger_pending') {
return ONE_MINUTE
}

@@ -973,7 +973,7 @@ export class SessionRecording {
}

// Clear the buffer if waiting for a trigger, and only keep data from after the current full snapshot
if (rawEvent.type === EventType.FullSnapshot && this.urlTriggerStatus === 'pending') {
if (rawEvent.type === EventType.FullSnapshot && this.urlTriggerStatus === 'trigger_pending') {
this.clearBuffer()
}

@@ -1175,8 +1175,8 @@ export class SessionRecording {
}

private _activateUrlTrigger() {
if (this.urlTriggerStatus === 'pending') {
this.urlTriggerStatus = 'activated'
if (this.urlTriggerStatus === 'trigger_pending') {
this.urlTriggerStatus = 'trigger_activated'
this._tryAddCustomEvent('url trigger activated', {})
this._flushBuffer()
logger.info(LOGGER_PREFIX + ' recording triggered by URL pattern match')