RUMM-2231 Fix the session management rules#948
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #948 +/- ##
===========================================
+ Coverage 83.20% 83.25% +0.05%
===========================================
Files 267 268 +1
Lines 9214 9251 +37
Branches 1484 1490 +6
===========================================
+ Hits 7666 7701 +35
Misses 1143 1143
- Partials 405 407 +2
🚀 New features to boost your workflow:
|
0xnm
reviewed
Jun 15, 2022
Comment on lines
+91
to
+107
| // | ||
| // if (event is RumRawEvent.StartView) { | ||
| // val viewScope = RumViewScope.fromEvent( | ||
| // this, | ||
| // event, | ||
| // firstPartyHostDetector, | ||
| // cpuVitalMonitor, | ||
| // memoryVitalMonitor, | ||
| // frameRateVitalMonitor, | ||
| // timeProvider, | ||
| // rumEventSourceProvider | ||
| // ) | ||
| // onViewDisplayed(event, viewScope, actualWriter) | ||
| // childrenScopes.add(viewScope) | ||
| // } else if (childrenScopes.count { it.isActive() } == 0) { | ||
| // handleOrphanEvent(event, actualWriter) | ||
| // } |
| type = RumViewScope.RumViewType.APPLICATION_LAUNCH | ||
| ) | ||
| } | ||
| /* |
Comment on lines
45
to
47
| private var resetSessionTime: Long? = null | ||
|
|
||
| internal var applicationDisplayed: Boolean = false |
Member
There was a problem hiding this comment.
seems these 2 are not used anymore in this class
| lastUserInteractionNs.set(nanoTime) | ||
| } else { | ||
| if (isExpired) { | ||
| sessionState = State.EXPIRED |
Member
There was a problem hiding this comment.
it means we kind of reduce the value of the background tracking? Because for background events it won't be any interactions, so any new session created as a result of the background event (say network call) will expire quickly and events coming later won't be sent.
mariusc83
reviewed
Jun 15, 2022
| childScope.handleEvent(event, actualWriter) | ||
|
|
||
| // | ||
| // if (event is RumRawEvent.StartView) { |
| } | ||
| /* | ||
|
|
||
| internal fun onViewDisplayed( |
xgouchet
force-pushed
the
xgouchet/RUMM-2231/fix_session_rules
branch
from
June 16, 2022 15:39
2e1919d to
9bde0eb
Compare
mariusc83
approved these changes
Jun 16, 2022
0xnm
approved these changes
Jun 17, 2022
xgouchet
force-pushed
the
xgouchet/RUMM-2231/fix_session_rules
branch
from
June 17, 2022 12:46
65fe7f8 to
fce3952
Compare
xgouchet
force-pushed
the
xgouchet/RUMM-2231/fix_session_rules
branch
from
June 20, 2022 07:46
fce3952 to
d88d2cd
Compare
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.
What does this PR do?
This PR improves the way we track session, and ensure the logic follows the expectation from our billing guidelines
We separate the
RumSessionScopeinto two classes:RumSessionScopewhich manages the session lifecycle (extending the life of a session, renewing or reseting a session)RumViewManagerScopewhich handles the different views and creates Background/AppLaunch views when necessary