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-2816 Session Replay Browser Record Receiver #1720

Merged
merged 4 commits into from
Mar 26, 2024

Conversation

maxep
Copy link
Member

@maxep maxep commented Mar 12, 2024

What and why?

Forward Browser records to Session Replay pipeline.

How?

The WebViewRecordReceiver will get Browser records from the message-bus, apply the NTP offset of the container RUM view and write it to Session Replay storage.

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

Custom CI job configuration (optional)

  • Run unit tests for Core, RUM, Trace, Logs, CR and WVT
  • Run unit tests for Session Replay
  • Run integration tests
  • Run smoke tests
  • Run tests for tools/

@maxep maxep self-assigned this Mar 12, 2024
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Mar 13, 2024

Datadog Report

Branch report: maxep/RUM-2816/web-view-sr-receiver
Commit report: 0242681
Test service: dd-sdk-ios

✅ 0 Failed, 2880 Passed, 0 Skipped, 32m 50.65s Wall Time
🔻 Test Sessions change in coverage: 8 decreased, 6 increased, 1 no change

🔻 Code Coverage Decreases vs Default Branch (8)

This report shows up to 5 code coverage decreases.

  • test SRSnapshotTests 33.01% (-0.59%) - Details
  • test DatadogRUMTests iOS 79.37% (-0.34%) - Details
  • test DatadogRUMTests tvOS 79.5% (-0.32%) - Details
  • test DatadogLogsTests iOS 45.79% (-0.15%) - Details
  • test DatadogLogsTests tvOS 45.84% (-0.15%) - Details

@maxep maxep force-pushed the maxep/RUM-2816/web-view-sr-receiver branch 6 times, most recently from 2ae4f21 to 08e8f24 Compare March 19, 2024 11:06
@maxep maxep marked this pull request as ready for review March 21, 2024 16:57
@maxep maxep requested review from a team as code owners March 21, 2024 16:57
@maxep maxep force-pushed the maxep/RUM-2816/web-view-sr-receiver branch from d95ca54 to 594b1e9 Compare March 21, 2024 17:50
@maxep maxep force-pushed the maxep/RUM-2816/web-view-sr-receiver branch from 594b1e9 to 0242681 Compare March 21, 2024 18:08
Comment on lines -78 to +68
if let viewID = self.viewCache.lastView(before: date, hasReplay: true) {
if let viewID = self.viewCache.lastView(before: correctedDate, hasReplay: true) {
Copy link
Member Author

Choose a reason for hiding this comment

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

We should actually use the corrected time so the browser view is associated to the right native view.

private enum Constants {
enum Constants {
Copy link
Member Author

Choose a reason for hiding this comment

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

for accessibility in tests.

internal struct RUMContext: Decodable, Equatable {
internal struct RUMContext: Codable, Equatable {
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding Encodable for tests.

static let totalWireframeMutationRecords = 7
static let totalWireframeMutationRecords = 5
Copy link
Member Author

Choose a reason for hiding this comment

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

Reflecting removal of the WKWebView from the unsupported views.

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.

LGTM

@@ -40,18 +40,6 @@ internal final class WebViewEventReceiver: FeatureMessageReceiver {
return false
}

write(event: event, to: core)
Copy link
Member

Choose a reason for hiding this comment

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

I can see, that change joins two functions. Does it make sense to keep it broken down to two functions? Just for the readability sake.

Copy link
Member Author

Choose a reason for hiding this comment

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

Lets keep it as one for now, we can revisit if it grow in complexity!

return offset
}
offsets.insert((id, offset), at: 0)
// only retain 3 offsets
Copy link
Member

Choose a reason for hiding this comment

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

why 3 only?

Copy link
Member Author

Choose a reason for hiding this comment

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

idk.. this is from the original imp of RUM web-view integration #683

Copy link
Member

@ncreated ncreated left a comment

Choose a reason for hiding this comment

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

Well done 👌. Glad to see integrat-unit added 🚀

@maxep maxep merged commit e25a3bf into feature/webview-replay Mar 26, 2024
10 checks passed
@maxep maxep deleted the maxep/RUM-2816/web-view-sr-receiver branch March 26, 2024 11:12
@maxep maxep mentioned this pull request Apr 15, 2024
8 tasks
@maciejburda maciejburda mentioned this pull request May 7, 2024
8 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.

3 participants