feat(replay): Change flush() API to record current event buffer#7743
Merged
feat(replay): Change flush() API to record current event buffer#7743
flush() API to record current event buffer#7743Conversation
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.
Contributor
size-limit report 📦
|
Member
Author
mydea
reviewed
Apr 5, 2023
mydea
reviewed
Apr 5, 2023
mydea
reviewed
Apr 5, 2023
mydea
reviewed
Apr 5, 2023
capture() API to record current event bufferflush() API to record current event buffer
billyvg
commented
Apr 5, 2023
Member
|
Also note that I would mark this as |
flush() API to record current event bufferflush() API to record current event buffer
mydea
reviewed
Apr 17, 2023
mydea
reviewed
Apr 17, 2023
| await this.flushImmediate(); | ||
|
|
||
| if (!continueRecording) { | ||
| return; |
Member
There was a problem hiding this comment.
Hmm, do we need to still stop the recording here? 🤔
Member
There was a problem hiding this comment.
May be simplified to:
if (!continueRecording || !hasStoppedRecording) {
return;
}
// Reset all ...
mydea
approved these changes
Apr 18, 2023
Member
mydea
left a comment
There was a problem hiding this comment.
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!
Member
Author
|
I think the jest tests are sufficient here, but I intend to add browser integration tests that should cover |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This changes the public API
flushto: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