Skip to content

RUM-16379: Fix dialog opening from another dialog in sr#3563

Draft
jonathanmos wants to merge 4 commits into
developfrom
jmoskovich/rum-16379/fix-bottomsheets-issue
Draft

RUM-16379: Fix dialog opening from another dialog in sr#3563
jonathanmos wants to merge 4 commits into
developfrom
jmoskovich/rum-16379/fix-bottomsheets-issue

Conversation

@jonathanmos

@jonathanmos jonathanmos commented Jun 22, 2026

Copy link
Copy Markdown
Member

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)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@datadog-datadog-prod-us1-2

This comment has been minimized.

@jonathanmos jonathanmos force-pushed the jmoskovich/rum-16379/fix-bottomsheets-issue branch 2 times, most recently from fb1d870 to 3fa1209 Compare June 28, 2026 12:04
@codecov-commenter

codecov-commenter commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.24528% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.83%. Comparing base (9e60d05) to head (17a292a).

Files with missing lines Patch % Lines
...rnal/mappers/semantics/AndroidComposeViewMapper.kt 50.00% 4 Missing and 2 partials ⚠️
...ternal/recorder/callback/RecorderWindowCallback.kt 90.00% 0 Missing and 3 partials ⚠️
...nreplay/internal/recorder/WindowReflectionUtils.kt 77.78% 1 Missing and 1 partial ⚠️
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     
Files with missing lines Coverage Δ
...ionreplay/compose/internal/utils/SemanticsUtils.kt 68.47% <100.00%> (+0.16%) ⬆️
...nreplay/internal/recorder/WindowReflectionUtils.kt 77.78% <77.78%> (ø)
...ternal/recorder/callback/RecorderWindowCallback.kt 92.24% <90.00%> (-0.86%) ⬇️
...rnal/mappers/semantics/AndroidComposeViewMapper.kt 73.08% <50.00%> (-19.78%) ⬇️

... and 43 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonathanmos jonathanmos force-pushed the jmoskovich/rum-16379/fix-bottomsheets-issue branch from 3fa1209 to 15d2c3d Compare June 28, 2026 18:25
@jonathanmos jonathanmos force-pushed the jmoskovich/rum-16379/fix-bottomsheets-issue branch from 15d2c3d to 17a292a Compare June 29, 2026 07:26
@jonathanmos jonathanmos marked this pull request as ready for review June 29, 2026 08:20
@jonathanmos jonathanmos requested review from a team as code owners June 29, 2026 08:20

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@jonathanmos jonathanmos marked this pull request as draft June 29, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants