-
Notifications
You must be signed in to change notification settings - Fork 142
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
👷♀️ [RUM 5088] Reduce INP Null Target #2950
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2950 +/- ##
==========================================
+ Coverage 93.19% 93.66% +0.47%
==========================================
Files 275 276 +1
Lines 7610 7626 +16
Branches 1707 1711 +4
==========================================
+ Hits 7092 7143 +51
+ Misses 518 483 -35 ☔ View full report in Codecov by Sentry. |
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
d321307
to
add9d1a
Compare
/to-staging |
17cff3c
to
399fb3a
Compare
8d7accc
to
9ba6691
Compare
const setInteractionMapSpy = spyOn(Map.prototype, 'set').and.callThrough() | ||
emulateClick({ activity: { on: 'pointerdown' } }) | ||
expect(setInteractionMapSpy).toHaveBeenCalled() |
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.
💬 suggestion: instead of checking for set
/ get
/delete
calls on Map, why not check if the expected value is actually in interactionSelectorMap
directly?
const setInteractionMapSpy = spyOn(Map.prototype, 'set').and.callThrough() | |
emulateClick({ activity: { on: 'pointerdown' } }) | |
expect(setInteractionMapSpy).toHaveBeenCalled() | |
emulateClick({ activity: { on: 'pointerdown' }, timeStamp: xxx }) | |
expect(interactionMap.get(xxx)).toBe(xxx) |
I think it would be more explicit and a bit "safer" (we are sure the value was set on the right Map)
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.
Thank you! The tests should be fixed with checking the map directly. This way is indeed more effective! TIL
packages/rum-core/src/domain/view/viewMetrics/trackInteractionToNextPaint.spec.ts
Outdated
Show resolved
Hide resolved
packages/rum-core/src/domain/action/interactionSelectorCache.ts
Outdated
Show resolved
Hide resolved
702e976
to
f029cd9
Compare
packages/rum-core/src/domain/action/interactionSelectorCache.ts
Outdated
Show resolved
Hide resolved
bf259e0
to
6e862a6
Compare
Motivation
Save the selector in a map with timestamp as key to mitigate the null target situation.
More information in RFC.
Changes
After mitigation, about 75% of null target INP would have a selector.
Testing
I have gone over the contributing documentation.