RUMM-2142: Allow global context update if view is stopped in a new session#913
Conversation
| ) | ||
| false | ||
| when { | ||
| currentContext.sessionId != this.sessionId -> { |
There was a problem hiding this comment.
If the session id is different then it might mean that another view is active, which you could be erasing here. What's your logic for doing this check?
There was a problem hiding this comment.
Normally it shouldn't be another view at this point, because the current one should be stopped first (if we are saying that stopView is called). If stopView is not called for current view and another view starts (via startView), then stopped flag will be true after onStartView with event having key of another view, so we won't even go in this logical branch.
Anyway, such override was a case even before, when GlobalRum.updateRumContext was called in onStopView without such verification, so at least we are not making things worse.
0be455f to
e04f942
Compare
| ) | ||
| false | ||
| when { | ||
| currentContext.sessionId != this.sessionId -> { |
There was a problem hiding this comment.
If the session id is different then it might mean that another view is active, which you could be erasing here. What's your logic for doing this check?
Codecov Report
@@ Coverage Diff @@
## develop #913 +/- ##
===========================================
- Coverage 83.07% 82.95% -0.12%
===========================================
Files 267 267
Lines 9047 9054 +7
Branches 1453 1455 +2
===========================================
- Hits 7515 7510 -5
- Misses 1137 1148 +11
- Partials 395 396 +1
|
What does this PR do?
This change should fix having a telemetry entry saying that current view ID doesn't match view ID in the global RUM context. This may happen if we update the context when new session started - this means we also change view ID for the current view.
This PR fixes that allowing update of the global context in case of the session ID mismatch.
Review checklist (to be filled by reviewers)