-
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
♻️ Base foreground computation on page lifecycle states #2253
♻️ Base foreground computation on page lifecycle states #2253
Conversation
}) | ||
}) | ||
|
||
it('should not record anything after reaching the maximum number of focus periods', () => { |
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've removed this test that is now covered by the ValueHistory used in pageStateHistory.ts
packages/rum-core/src/domain/rumEventsCollection/action/actionCollection.ts
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## main #2253 +/- ##
==========================================
- Coverage 94.23% 94.16% -0.08%
==========================================
Files 206 206
Lines 6180 6118 -62
Branches 1368 1354 -14
==========================================
- Hits 5824 5761 -63
- Misses 356 357 +1
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Great work!
view: { in_foreground: pageStateHistory.isInActivePageStateAt(action.startClocks.relative) }, | ||
}, | ||
autoActionProperties | ||
) | ||
const inForeground = foregroundContexts.isInForegroundAt(action.startClocks.relative) | ||
if (inForeground !== undefined) { | ||
actionEvent.view = { in_foreground: inForeground } | ||
} | ||
|
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: what about keeping the same logic of not adding the view.in_foreground
if there is no active page state?
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.
The previous foregroundContexts.isInForegroundAt(action.startClocks.relative)
always return a boolean so inForeground !== undefined
is always true
Motivation
Follow up of #2229: Base foreground computation on page lifecycle states
Changes
pageStateHistory.isActiveAt()
to replaceforegroundContexts.isInForegroundAt()
pageStateHistory
(implementmapToForegroundPeriods()
)Testing
I have gone over the contributing documentation.