Skip to content

feat(network-details): Extract network details data to Session Replay #7591

@github-actions

Description

@github-actions

Note

The pull request "feat(network-details): Extract network details data to Session Replay" was created by @43jay but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.

📜 Description

Upload network details data (SentryNetworkRequestData) extracted by SentryNetworkTracker to the session replay backend.

SentryNetworkRequestData
Stored on the NSURLSessionTask while waiting for data (PREVIOUS PR)

SentryNetworkRequestData *networkRequestData
        = objc_setAssociatedObject(sessionTask, &SentryNetworkRequestDataKey);

Stored in the Breadcrumb data after task has completed (addBreadcrumbForSessionTask) (THIS PR)

breadcrumbData[SentryReplayNetworkDetailsKey]

Extracted from Breadcrumb into RRWebEvent (SentrySRDefaultBreadcrumbConverter) (THIS PR)

 SentryNetworkRequestData.serialize

💡 Motivation and Context

Last leg of data upload; now data is visible in replay dash.

💚 How did you test it?

Manual Testing with iOS-Swift test app

  1. Build and install
xcodebuild -workspace Sentry.xcworkspace -scheme iOS-Swift -sdk iphonesimulator -destination  'platform=iOS Simulator,name=iPhone 16 Pro' clean build

xcrun simctl install "iPhone 16 Pro"  ~/Library/Developer/Xcode/DerivedData/Sentry-*/Build/Products/Debug-iphonesimulator/iOS-Swift.app
  1. Navigate to Extras > Network Details

  2. Initiate different types of request

  3. Navigate to sentry.io test project and confirm session replay 'Network' tab shows requests with correct body and headers.

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled. gated by SentryReplayOptions#networkDetailAllowUrls
  • I updated the docs if needed.
  • I updated the wizard if needed. n/a
  • Review from the native team if needed. n/a
  • No breaking change or entry added to the changelog. future PR #skip-changelog
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions