Skip to content

PANA-8893: Enable Composition Tree recording in Session Replay - #1393

Merged
gonzalezreal merged 3 commits into
developfrom
gonzalezreal/PANA-8893/enable-composition-tree-recording
Sep 2, 2026
Merged

PANA-8893: Enable Composition Tree recording in Session Replay#1393
gonzalezreal merged 3 commits into
developfrom
gonzalezreal/PANA-8893/enable-composition-tree-recording

Conversation

@gonzalezreal

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds an enableCompositionTreeRecording option to the Session Replay configuration.

When enabled on iOS 13+, Session Replay uses the experimental Composition Tree recording pipeline. React Native text and SVG recorders are not configured because they do not apply to this pipeline.

The option defaults to false. It is forwarded on Android but has no effect until Android support is implemented.

Motivation

Allow React Native users to opt into the Composition Tree recording pipeline introduced in dd-sdk-ios 3.16.0

Additional Notes

The public API, native bridges, and tests have been updated for both React Native architectures.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • 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)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

Copilot AI lite review requested due to automatic review settings September 1, 2026 14:34
@gonzalezreal
gonzalezreal requested a review from a team as a code owner September 1, 2026 14:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new enableCompositionTreeRecording option to the React Native Session Replay configuration to allow opting into the experimental “Composition Tree” recording pipeline (iOS 13+), while forwarding the flag through the Android bridge for future support.

Changes:

  • Adds enableCompositionTreeRecording to the public JS/TS API, internal config, and native module method signatures.
  • Updates iOS native implementation to set the composition-tree feature flag (iOS 13+) and to skip additional RN node recorders when enabled.
  • Updates JS, iOS, and Android unit tests to account for the new argument and adds iOS-specific behavioral tests.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/react-native-session-replay/src/specs/NativeDdSessionReplay.ts Extends the TurboModule spec enable() signature with the new flag.
packages/react-native-session-replay/src/SessionReplay.ts Adds the new configuration option, defaulting/forwarding it into the native bridge call.
packages/react-native-session-replay/src/nativeModulesTypes.ts Updates typed native module interface to include the new flag.
packages/react-native-session-replay/src/tests/SessionReplay.test.ts Updates JS unit tests for the new native argument and adds a forwarding test.
packages/react-native-session-replay/ios/Sources/DdSessionReplayImplementation.swift Implements the iOS feature-flag and conditional recorder configuration behavior.
packages/react-native-session-replay/ios/Sources/DdSessionReplay.mm Updates ObjC bridge method signatures to pass the new flag into Swift.
packages/react-native-session-replay/ios/Tests/DdSessionReplayTests.swift Updates existing tests and adds iOS behavior tests for composition-tree mode.
packages/react-native-session-replay/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementation.kt Accepts the new flag (currently unused) and keeps Android behavior unchanged.
packages/react-native-session-replay/android/src/oldarch/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplay.kt Updates old-arch module method signature to accept/forward the new flag.
packages/react-native-session-replay/android/src/newarch/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplay.kt Updates new-arch module method signature to accept/forward the new flag.
packages/react-native-session-replay/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementationTest.kt Updates Android unit tests to pass the new flag argument.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 1, 2026 15:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings September 1, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The cross-platform API/bridge wiring is consistent and covered by updated tests, with only a minor documentation accuracy nit remaining.

Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 1
  • Review effort level: Lite

@marco-saia-datadog marco-saia-datadog left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@gonzalezreal
gonzalezreal merged commit 6343530 into develop Sep 2, 2026
13 checks passed
@gonzalezreal
gonzalezreal deleted the gonzalezreal/PANA-8893/enable-composition-tree-recording branch September 2, 2026 09:23
@sbarrio sbarrio mentioned this pull request Sep 3, 2026
4 tasks
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.

5 participants