-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(replay): Handle checkouts more explicitly #7321
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
Conversation
@@ -40,5 +29,16 @@ | |||
"id": 15, | |||
"x": 157, | |||
"y": 90 | |||
}, |
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.
I have no idea why this is suddenly ordered differently... It seems to be consistently so now. Not sure @cmanallen / @billyvg if you know, does this make any difference, or is the order of records in this incremental snapshot array not important? I don't really see timestamps here, but not sure...
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 not sure, also interesting it doesn't have a type either
"rel": "icon", | ||
"type": "image/png", | ||
"href": "file://assets/icon/favicon.png" | ||
"rr_width": "[0-50]px", |
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.
This is unrelated but wasn't updated and fails locally.
size-limit report 📦
|
4bbec5d
to
ee92a14
Compare
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 - also thanks for extracting out the function (I think we can take the slight bundle size hit over readability/maintainability)
@@ -45,21 +45,31 @@ sentryTest( | |||
|
|||
const reqPromise0 = waitForReplayRequest(page, 0); | |||
const reqPromise1 = waitForReplayRequest(page, 1); | |||
const reqPromise2 = waitForReplayRequest(page, 2); |
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.
(no action required)
Good change, let's just always keep these at the top of tests for consistency going forward
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.
Makes sense to me, I think the missing isCheckout
on the initial payload is why I had originally used the FullSnapshot type.
@@ -40,5 +29,16 @@ | |||
"id": 15, | |||
"x": 157, | |||
"y": 90 | |||
}, |
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 not sure, also interesting it doesn't have a type either
c6a8c24
to
cdb2b17
Compare
cdb2b17
to
c6cef1b
Compare
We used to look at
event.type === 2
for replay events to infer if something is a checkout or not.This is a bit hacky, as type === 2 actually just means it is a full snapshot, which may or may not be due to a checkout.
This makes it hard/impossible to do any future changes where we may want to do a full snapshot in other scenarios than in error mode, e.g. if we want to do a full snapshot to avoid large mutations.
This PR refactors this a bit to really just look at
isCheckout
, plus also handle the very first rrweb event as a checkout (because we rely on this a bit).This replaces #7237