Skip to content

PANA-5681: Integrate HeatmapIdentifierRegistry into Session Replay for heatmaps [4 of 4]#3206

Open
gonzalezreal wants to merge 2 commits into
feature/heatmapsfrom
gonzalezreal/PANA-5681/session-replay-heatmaps
Open

PANA-5681: Integrate HeatmapIdentifierRegistry into Session Replay for heatmaps [4 of 4]#3206
gonzalezreal wants to merge 2 commits into
feature/heatmapsfrom
gonzalezreal/PANA-5681/session-replay-heatmaps

Conversation

@gonzalezreal
Copy link
Copy Markdown

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
Copy Markdown

@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".

@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
Copy Markdown

codecov-commenter commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 92.06349% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.16%. Comparing base (ac886da) to head (03802d0).

Files with missing lines Patch % Lines
...lay/internal/recorder/HeatmapIdentifierResolver.kt 90.91% 6 Missing and 1 partial ⚠️
...essionreplay/internal/recorder/SnapshotProducer.kt 92.68% 0 Missing and 3 partials ⚠️
...internal/recorder/DefaultOnDrawListenerProducer.kt 50.00% 2 Missing ⚠️
...nreplay/internal/recorder/SessionReplayRecorder.kt 85.71% 1 Missing and 1 partial ⚠️
.../sessionreplay/internal/processor/NodeFlattener.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##           feature/heatmaps    #3206      +/-   ##
====================================================
+ Coverage             72.04%   72.16%   +0.12%     
====================================================
  Files                   967      970       +3     
  Lines                 35499    35656     +157     
  Branches               5887     5936      +49     
====================================================
+ Hits                  25575    25730     +155     
+ Misses                 8304     8300       -4     
- Partials               1620     1626       +6     
Files with missing lines Coverage Δ
...dog/android/internal/heatmaps/HeatmapIdentifier.kt 77.78% <100.00%> (ø)
.../sessionreplay/internal/DefaultRecorderProvider.kt 94.37% <100.00%> (+0.04%) ⬆️
...play/internal/DeferredHeatmapIdentifierRegistry.kt 100.00% <100.00%> (ø)
...replay/internal/SessionReplayRumContextProvider.kt 92.31% <100.00%> (+0.64%) ⬆️
...onreplay/internal/processor/HeatmapWireframeExt.kt 100.00% <100.00%> (ø)
...ssionreplay/internal/processor/MutationResolver.kt 89.45% <100.00%> (+0.04%) ⬆️
...og/android/sessionreplay/internal/recorder/Node.kt 100.00% <100.00%> (ø)
...nternal/recorder/listener/WindowsOnDrawListener.kt 93.18% <100.00%> (+0.50%) ⬆️
...onreplay/internal/utils/SessionReplayRumContext.kt 90.91% <100.00%> (+0.91%) ⬆️
.../sessionreplay/internal/processor/NodeFlattener.kt 94.44% <50.00%> (-5.56%) ⬇️
... and 4 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.

@jonathanmos jonathanmos marked this pull request as draft May 5, 2026 10:51
@jonathanmos jonathanmos changed the title PANA-5681: Integrate ViewIdentityResolver into Session Replay for heatmaps PANA-5681: Integrate ViewIdentityResolver into Session Replay for heatmaps [4 of 4] May 5, 2026
@jonathanmos jonathanmos force-pushed the gonzalezreal/PANA-5681/rum-heatmaps branch 2 times, most recently from cbfbf76 to 9a2e330 Compare May 14, 2026 12:23
@jonathanmos jonathanmos changed the title PANA-5681: Integrate ViewIdentityResolver into Session Replay for heatmaps [4 of 4] PANA-5681: Integrate HeatmapIdentifierRegistry into Session Replay for heatmaps [4 of 4] May 14, 2026
@jonathanmos jonathanmos changed the title PANA-5681: Integrate HeatmapIdentifierRegistry into Session Replay for heatmaps [4 of 4] PANA-5681: Integrate HeatmapIdentifierRegistry into Session Replay for heatmaps [4 of 4] May 14, 2026
@jonathanmos jonathanmos force-pushed the gonzalezreal/PANA-5681/rum-heatmaps branch from 9a2e330 to e63b7f4 Compare May 18, 2026 08:12
@jonathanmos jonathanmos force-pushed the gonzalezreal/PANA-5681/rum-heatmaps branch from 6210b4b to fa8baf8 Compare May 28, 2026 13:19
Base automatically changed from gonzalezreal/PANA-5681/rum-heatmaps to feature/heatmaps June 1, 2026 09:09
@jonathanmos jonathanmos force-pushed the gonzalezreal/PANA-5681/session-replay-heatmaps branch 4 times, most recently from 803a051 to 11ba9b6 Compare June 4, 2026 07:56
@jonathanmos jonathanmos force-pushed the gonzalezreal/PANA-5681/session-replay-heatmaps branch from 11ba9b6 to 2df9570 Compare June 4, 2026 08:35
@jonathanmos jonathanmos force-pushed the gonzalezreal/PANA-5681/session-replay-heatmaps branch from 0014da6 to 03802d0 Compare June 4, 2026 10:55
@jonathanmos jonathanmos marked this pull request as ready for review June 4, 2026 11:45
Copy link
Copy Markdown

@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: 03802d0335

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

// Validate that the cached path's own component matches the freshly computed one.
// Guards against stale entries when a view changes sibling position without being
// detached (e.g. notifyItemMoved with an in-place animator).
?.takeIf { it.viewPath.lastOrNull() == pathComponent }
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 Recompute cached descendants when ancestor path changes

When a non-clickable ViewGroup with clickable descendants is reordered among same-type siblings, the container's nodePath changes but each child keeps the same direct parent and child component. This cache check only validates the child's last path component, so resolveIdentity() reuses the old viewPath/permanentId for the descendant and publishIfChanged() may skip updating the registry, causing heatmap actions for the moved child to correlate to its previous hierarchy position. Include the current nodePath prefix in the cache validation before reusing the entry.

Useful? React with 👍 / 👎.

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.

3 participants