-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(replay): Change flush()
API to record current event buffer
#7743
Conversation
This adds a public API: `capture` that will record the current event buffer and by default, convert the replay type to "session" and continue recording. We have extracted the logic that was used for "onError" capturing and made it a public API.
size-limit report 📦
|
capture()
API to record current event bufferflush()
API to record current event buffer
Also note that I would mark this as |
flush()
API to record current event bufferflush()
API to record current event buffer
await this.flushImmediate(); | ||
|
||
if (!continueRecording) { | ||
return; |
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.
Hmm, do we need to still stop the recording here? 🤔
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.
May be simplified to:
if (!continueRecording || !hasStoppedRecording) {
return;
}
// Reset all ...
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.
LGTM!
Maybe we should also add two tests in browser-integration-tests checking that the public API of flush
works as expected with/without continueRecording? But we can also do that in a followup, I guess!
I think the jest tests are sufficient here, but I intend to add browser integration tests that should cover |
This changes the public API
flush
to:flush({continueRecording: false})
to stop recording immediately after flushingEssentially, we have extracted the same logic that was used for "onError" capturing and made it a public API.
Closes #7737
Partially addresses #7770