Skip to content

[Flutter hybrid support] Add slotId support to Full/Incremental snapshot records - #3674

Closed
jonathanmos wants to merge 1 commit into
feature/flutter-supportfrom
jmoskovich/01-slotid-support-snapshot-records
Closed

[Flutter hybrid support] Add slotId support to Full/Incremental snapshot records#3674
jonathanmos wants to merge 1 commit into
feature/flutter-supportfrom
jmoskovich/01-slotid-support-snapshot-records

Conversation

@jonathanmos

Copy link
Copy Markdown
Member

What does this PR do?

Extends the slotId field (already present on MetaRecord/FocusRecord) to MobileFullSnapshotRecord and MobileIncrementalSnapshotRecord, so full and incremental snapshot records can also be tagged with a slot identifier.

Motivation

Groundwork for correlating Session Replay records produced by an embedded rendering engine (e.g. Flutter) back to their placeholder slot on the native side.

Additional Notes

  • slotId is optional and defaults to null; when null it's omitted from serialization (slotId?.let { ... } in generated toJson()), so existing record payloads are byte-for-byte unchanged.
  • Public constructor signature for both record types changes (slotId inserted between timestamp and data) — same precedent already shipped for MetaRecord/FocusRecord, not a new risk category.
  • No behavioral change to any existing recorder flow; verified full test suite passes in isolation.

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)

@jonathanmos jonathanmos changed the title Add slotId support to Full/Incremental snapshot records [Flutter hybrid support] Add slotId support to Full/Incremental snapshot records Jul 28, 2026
@jonathanmos
jonathanmos requested a review from Copilot July 28, 2026 12:47

Copilot AI 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.

Pull request overview

This PR extends the existing optional slotId tagging capability (already used by MetaRecord/FocusRecord) to MobileFullSnapshotRecord and MobileIncrementalSnapshotRecord, enabling Session Replay snapshot records to be correlated back to a native “slot” (e.g., for embedded engines like Flutter).

Changes:

  • Updated the JSON schemas for full/incremental snapshot records to inherit from the slot-aware common record schema.
  • Updated internal record creation and test forgeries to use the new constructor shape (with slotId defaulting to null).
  • Updated the Session Replay module API surface files to reflect the public model change.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/forge/IncrementalSnapshotRecordForgeryFactory.kt Generates incremental snapshot records including optional slotId for tests.
features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/forge/FullSnapshotRecordForgeryFactory.kt Generates full snapshot records including optional slotId for tests.
features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/processor/RecordedDataProcessor.kt Constructs snapshot records using named args so slotId can safely default to null.
features/dd-sdk-android-session-replay/src/main/json/schemas/session-replay/mobile/incremental-snapshot-record-schema.json Switches base schema to _slot-supported-common-record-schema.json to add slotId.
features/dd-sdk-android-session-replay/src/main/json/schemas/session-replay/mobile/full-snapshot-record-schema.json Switches base schema to _slot-supported-common-record-schema.json to add slotId.
features/dd-sdk-android-session-replay/api/dd-sdk-android-session-replay.api Updates API dump to include the new constructor/copy/component signatures and getSlotId().
features/dd-sdk-android-session-replay/api/apiSurface Updates checked-in API surface to include slotId: String? = null in both snapshot record constructors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.24%. Comparing base (b78b347) to head (4e24dbf).
⚠️ Report is 30 commits behind head on feature/flutter-support.

Additional details and impacted files
@@                     Coverage Diff                     @@
##           feature/flutter-support    #3674      +/-   ##
===========================================================
- Coverage                    73.31%   73.24%   -0.07%     
===========================================================
  Files                          995      995              
  Lines                        36312    36305       -7     
  Branches                      6134     6136       +2     
===========================================================
- Hits                         26622    26591      -31     
- Misses                        7983     8002      +19     
- Partials                      1707     1712       +5     
Files with missing lines Coverage Δ
...replay/internal/processor/RecordedDataProcessor.kt 97.73% <100.00%> (ø)

... and 36 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.

3 participants