Skip to content

fix(replay): Do not depend on event.type to infer isCheckout #7237

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

Closed
wants to merge 1 commit into from

Conversation

mydea
Copy link
Member

@mydea mydea commented Feb 21, 2023

This relies on getsentry/rrweb#56 to be merged & released first.

Currently, checking the type of the event is a bit brittle to infer if something is happening (e.g. the "checkout" event is often of type 4 and happens before the type 2 full snapshot).

This is a requirement to get something like getsentry/rrweb#55 landed, as that can trigger more full snapshots (without being a checkout), which in turn would lead to the error recording stuff not working as expected here.

@mydea mydea added the Package: replay Issues related to the Sentry Replay SDK label Feb 21, 2023
@mydea mydea requested review from billyvg and Lms24 February 21, 2023 10:39
@mydea mydea self-assigned this Feb 21, 2023
@@ -534,17 +534,16 @@ export class ReplayContainer implements ReplayContainerInterface {
// when an error occurs. Clear any state that happens before this current
// checkout. This needs to happen before `addEvent()` which updates state
// dependent on this reset.
if (this.recordingMode === 'error' && event.type === 2) {
if (this.recordingMode === 'error' && isCheckout) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this impact the behavior of start/stop recording in any way? I believe we should have test coverage around it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So right now it will, because we do not always have isCheckout === true on initial snapshots. So we would need to to merge getsentry/rrweb#56 in first to make this work as expected, I think.

@mydea
Copy link
Member Author

mydea commented Mar 2, 2023

Replaced by #7321

@mydea mydea closed this Mar 2, 2023
@mydea mydea deleted the fn/replay-check-checkout branch May 2, 2023 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: replay Issues related to the Sentry Replay SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants