RUM-7924: Fix Session Replay is not resumed after the session has expired before#2611
Merged
Conversation
ambushwork
force-pushed
the
yl/replay-investigation
branch
2 times, most recently
from
April 24, 2025 10:05
c827219 to
409d5c2
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2611 +/- ##
===========================================
+ Coverage 69.97% 70.00% +0.03%
===========================================
Files 820 820
Lines 30554 30562 +8
Branches 5130 5130
===========================================
+ Hits 21379 21393 +14
+ Misses 7747 7741 -6
Partials 1428 1428
🚀 New features to boost your workflow:
|
ambushwork
force-pushed
the
yl/replay-investigation
branch
from
April 24, 2025 10:38
409d5c2 to
30eca9a
Compare
ambushwork
marked this pull request as ready for review
April 24, 2025 11:37
jonathanmos
previously approved these changes
Apr 24, 2025
ambushwork
force-pushed
the
yl/replay-investigation
branch
from
April 24, 2025 15:08
30eca9a to
2e6514d
Compare
ambushwork
force-pushed
the
yl/replay-investigation
branch
from
April 24, 2025 15:26
2e6514d to
d9fcc99
Compare
jonathanmos
approved these changes
Apr 24, 2025
aleksandr-gringauz
approved these changes
Apr 24, 2025
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 is a bug fix based on a support ticket saying they don't see session replay for some of their sessions, after investigating there some key points which lead to the issue.
backgroundTrackingEnabledto false inRumConfigurationAfter looking into code, it turns out that the expiration of the session will make
keepSessionfalse, and stop recording inSessionReplayFeature, whenkeepSessionbecomes true due to new user interactions, session replay will not be able to resume.This PR fixes this case and add a unit test to protect against this corner case. To achieve that, there are some import flag changes in
SessionReplayFeature:shouldRecordflag now becomes a definitive state if the recording should be started or stopped, meaning that it will be decided by the other flags (userOption,keepSessions,isSampled), it should not be changed directly outsidemodifyShouldRecordStatefunctionuserOptionflag is added to indicate the current user decision about recording, it usesstartRecordingImmediatelyas default value, and can be set to true if user callsmanuallyStartRecordingand can be set to false if user callsmanuallyStopRecording.now in
SessionReplayFeaturethe state flow becomes:Motivation
RUM-7924
Review checklist (to be filled by reviewers)