Skip to content

PANA-5681: Integrate ViewIdentityResolver into Session Replay for heatmaps#3206

Open
gonzalezreal wants to merge 2 commits intogonzalezreal/PANA-5681/rum-heatmapsfrom
gonzalezreal/PANA-5681/session-replay-heatmaps
Open

PANA-5681: Integrate ViewIdentityResolver into Session Replay for heatmaps#3206
gonzalezreal wants to merge 2 commits intogonzalezreal/PANA-5681/rum-heatmapsfrom
gonzalezreal/PANA-5681/session-replay-heatmaps

Conversation

@gonzalezreal
Copy link

What does this PR do?

Wires ViewIdentityResolver into Session Replay to populate permanentId on wireframes. This enables correlating wireframes with RUM action events for heatmap visualization.

Key changes:

  • Adds public ViewIdentityProvider interface for Session Replay's view identity resolution
  • Adapts internal ViewIdentityResolver (from RUM feature context) via ViewIdentityResolverAdapter
  • Adds viewIdentityProvider to MappingContext for use by all wireframe mappers
  • Populates permanentId in all wireframe types (Shape, Text, Image, Placeholder, Webview)
  • Calls onWindowRefreshed() on each draw pass to index the current view hierarchy

Motivation

Support mobile heatmaps. This is the final piece connecting Session Replay wireframes to RUM actions.

Additional Notes

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)

@gonzalezreal gonzalezreal marked this pull request as ready for review February 27, 2026 10:40
@gonzalezreal gonzalezreal requested review from a team as code owners February 27, 2026 10:40
Copy link

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

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: 39a5a2b5af

ℹ️ 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".

* Retrieves [ViewIdentityResolver] from RUM's feature context, or [NoOpViewIdentityResolver] if unavailable.
*/
internal fun FeatureSdkCore.getViewIdentityResolver(): ViewIdentityResolver {
val rumContext = getFeatureContext(Feature.RUM_FEATURE_NAME)

Choose a reason for hiding this comment

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

P2 Badge Avoid blocking feature-context reads in draw hot path

getViewIdentityResolver() calls getFeatureContext(Feature.RUM_FEATURE_NAME) with the default useContextThread=true; in DatadogCore.getFeatureContext this path submits work to the context executor and waits for the result synchronously. Because this helper is now used during on-draw snapshot capture (and also from image wireframe mapping), the render-time path adds avoidable cross-thread blocking lookups each frame, which can introduce jank on view-heavy/image-heavy screens.

Useful? React with 👍 / 👎.

@gonzalezreal gonzalezreal force-pushed the gonzalezreal/PANA-5681/session-replay-heatmaps branch from 39a5a2b to 2f8955a Compare February 27, 2026 13:25
@datadog-datadog-prod-us1-2

This comment has been minimized.

@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 87.75510% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.46%. Comparing base (e76417d) to head (5f41dab).

Files with missing lines Patch % Lines
...nternal/recorder/mapper/CheckableTextViewMapper.kt 0.00% 3 Missing ⚠️
...play/internal/recorder/NoOpViewIdentityProvider.kt 0.00% 1 Missing ⚠️
...y/internal/recorder/ViewIdentityResolverAdapter.kt 66.67% 1 Missing ⚠️
...onreplay/internal/utils/ViewIdentityResolverExt.kt 66.67% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                           Coverage Diff                           @@
##           gonzalezreal/PANA-5681/rum-heatmaps    #3206      +/-   ##
=======================================================================
+ Coverage                                71.40%   71.46%   +0.07%     
=======================================================================
  Files                                      930      933       +3     
  Lines                                    34578    34610      +32     
  Branches                                  5845     5846       +1     
=======================================================================
+ Hits                                     24688    24734      +46     
+ Misses                                    8251     8245       -6     
+ Partials                                  1639     1631       -8     
Files with missing lines Coverage Δ
...nreplay/internal/recorder/SessionReplayRecorder.kt 95.56% <100.00%> (+0.03%) ⬆️
...essionreplay/internal/recorder/SnapshotProducer.kt 95.95% <100.00%> (+0.06%) ⬆️
...nternal/recorder/listener/WindowsOnDrawListener.kt 93.33% <100.00%> (+0.65%) ⬆️
...ternal/recorder/mapper/ActionBarContainerMapper.kt 90.91% <100.00%> (+0.43%) ⬆️
...eplay/internal/recorder/mapper/HiddenViewMapper.kt 100.00% <100.00%> (ø)
...rnal/recorder/mapper/ProgressBarWireframeMapper.kt 90.48% <100.00%> (+0.11%) ⬆️
...lay/internal/recorder/mapper/SwitchCompatMapper.kt 88.00% <100.00%> (+0.10%) ⬆️
.../internal/recorder/mapper/UnsupportedViewMapper.kt 100.00% <100.00%> (ø)
...ay/internal/recorder/mapper/ViewWireframeMapper.kt 100.00% <100.00%> (ø)
.../recorder/resources/DefaultImageWireframeHelper.kt 97.97% <100.00%> (+0.06%) ⬆️
... and 8 more

... and 35 files with indirect coverage changes

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

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