-
-
Notifications
You must be signed in to change notification settings - Fork 408
fix(replay): stop touch tracker when session replay is paused #8456
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: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -194,6 +194,7 @@ private struct SessionSegmentState { | |
| self.rootView = rootView | ||
| let now = dateProvider.date() | ||
| resetCapturePacing(at: now) | ||
| touchTracker?.isEnabled = true | ||
| startCaptureScheduler() | ||
| state.withLock { | ||
| $0.segmentState.reset() | ||
|
|
@@ -233,6 +234,7 @@ private struct SessionSegmentState { | |
| public func pause() { | ||
| SentrySDKLog.debug("[Session Replay] Pausing session") | ||
| stopCaptureScheduler() | ||
| touchTracker?.isEnabled = false | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The Suggested FixThe Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. |
||
|
|
||
| let pauseDate = dateProvider.date() | ||
| let shouldPreparePauseSegment = state.withLock { (state: inout State) -> Bool in | ||
|
|
@@ -282,6 +284,7 @@ private struct SessionSegmentState { | |
| guard let self = self else { return } | ||
|
|
||
| if self.startCaptureScheduler(expectedGeneration: schedulerGeneration) { | ||
| self.touchTracker?.isEnabled = true | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resume race re-enables paused touchesMedium Severity
Additional Locations (1)Reviewed by Cursor Bugbot for commit 73240d5. Configure here. |
||
| self.resetCapturePacing(at: self.dateProvider.date()) | ||
| } | ||
| } | ||
|
|
||


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.
Touches stay disabled after restart
High Severity
pause()setsisEnabledtofalseon the sharedtouchTracker, but onlyresume()turns it back on.start()reuses that same tracker without resettingisEnabled, so afterstop()/start(), session rotation, or max-duration end, touch capture can stay off for the rest of the process unless a laterresume()happens to run.Additional Locations (2)
Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift#L284-L287Sources/Swift/Integrations/SessionReplay/SentryTouchTracker.swift#L70-L74Reviewed by Cursor Bugbot for commit 73240d5. Configure here.