RUM-16379: Fix dialog opening from another dialog in sr#3563
RUM-16379: Fix dialog opening from another dialog in sr#3563jonathanmos wants to merge 4 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
fb1d870 to
3fa1209
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #3563 +/- ##
===========================================
+ Coverage 72.80% 72.83% +0.03%
===========================================
Files 974 975 +1
Lines 35228 35283 +55
Branches 5965 5979 +14
===========================================
+ Hits 25645 25696 +51
+ Misses 7915 7912 -3
- Partials 1668 1675 +7
🚀 New features to boost your workflow:
|
3fa1209 to
15d2c3d
Compare
15d2c3d to
17a292a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17a292a2c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| asyncJobStatusCallback, | ||
| internalLogger | ||
| ) | ||
| ).map { it.withWindowOffset(windowOffsetX, windowOffsetY) } |
There was a problem hiding this comment.
Avoid double-offsetting interop View wireframes
When a Compose dialog contains an AndroidView/interop node, RootSemanticsNodeMapper delegates it to mappingContext.interopViewCallback.map(), which traverses the Android View with the normal view mappers and DefaultViewBoundsResolver.getLocationOnScreen(), so those wireframes are already screen-absolute. Offsetting the entire returned list here shifts those interop wireframes by the dialog position a second time, causing embedded Android Views inside offset Compose roots/dialogs to appear in the wrong location.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I'll move this change into it's own pr
| decorView.post { | ||
| if (window.callback !is RecorderWindowCallback) { | ||
| val toWrap = window.callback ?: NoOpWindowCallback() | ||
| window.callback = RecorderWindowCallback( |
There was a problem hiding this comment.
Track dynamically wrapped dialog callbacks for teardown
This new path installs a RecorderWindowCallback directly on dialog windows, but those windows are never added to WindowCallbackInterceptor's wrappedWindows set. If Session Replay is stopped while such a dialog is still open, SessionReplayRecorder.stopRecorders() calls windowCallbackInterceptor.stopIntercepting(), which can only restore callbacks it knows about, so this dialog keeps Datadog's callback installed and can continue intercepting focus/touch events after recording was stopped.
Useful? React with 👍 / 👎.
| decorView.post { | ||
| if (window.callback !is RecorderWindowCallback) { | ||
| val toWrap = window.callback ?: NoOpWindowCallback() | ||
| window.callback = RecorderWindowCallback( |
There was a problem hiding this comment.
Use raw coordinates for dialog touch privacy
When this installs the same callback on an offset dialog, dispatchTouchEvent() still checks TouchPrivacyManager with event.x/event.y, which are window-local for the dialog, while Android View override areas are added from getLocationOnScreen() during traversal. A dialog containing a view-level touch privacy override will therefore compare local touch points against screen-absolute rectangles, so touches inside the overridden dialog view can be incorrectly hidden or recorded.
Useful? React with 👍 / 👎.
What does this PR do?
Fixes an issue recording dialogs opened from within other dialogs in session replay. This pr also includes a couple of other small fixes:
• Fixes a crash in the fine grained masking screen in the sample application
• Guard against NaN fontsize by providing a default fallback value.
Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)