Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUM-7937 [SR] Use Deterministic Random Wireframe ID #2169

Merged

Conversation

maxep
Copy link
Member

@maxep maxep commented Jan 8, 2025

What and why?

Session Replay of SwiftUI is generating staling views in replays, this is due to duplicate wireframe IDs between UIKit recorder and SwiftUI. UIKit recorders use incremental wireframe ids while SwiftUI is based on a seed value of the content, these value can overlap and create duplicates.

How?

To avoid overlaps, we now use a seeded random generator to generate deterministic IDs base of the content's seed value.
The deterministic generator implements the xoshiro256** generator for its speed and low memory footprint.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes
  • Add Objective-C interface for public APIs (see our guidelines [internal]) and run make api-surface)

@maxep maxep requested review from a team as code owners January 8, 2025 16:49
@maxep maxep force-pushed the maxep/RUM-7937/fix-duplicated-swiftui-wireframe-id branch from fa20614 to f763e63 Compare January 8, 2025 16:50
@datadog-datadog-prod-us1
Copy link

Datadog Report

Branch report: maxep/RUM-7937/fix-duplicated-swiftui-wireframe-id
Commit report: f763e63
Test service: dd-sdk-ios

✅ 0 Failed, 14 Passed, 3624 Skipped, 18.31s Total duration (2m 9.54s time saved)

Copy link
Member

@maciejburda maciejburda left a comment

Choose a reason for hiding this comment

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

Nice find and witty solution! 🙇

@maxep
Copy link
Member Author

maxep commented Jan 9, 2025

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jan 9, 2025

Devflow running: /merge

View all feedbacks in Devflow UI.


2025-01-09 11:16:57 UTC ℹ️ MergeQueue: pull request added to the queue

The median merge time in develop is 27m.


2025-01-09 11:44:45 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit a13a516 into develop Jan 9, 2025
15 checks passed
@maxep maxep deleted the maxep/RUM-7937/fix-duplicated-swiftui-wireframe-id branch January 10, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants