feat(network-details): Hook up request/response capture in SentryNetworkTracker#7588
feat(network-details): Hook up request/response capture in SentryNetworkTracker#758843jay wants to merge 2 commits intomobile-935/extract-network-detailsfrom
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## mobile-935/extract-network-details #7588 +/- ##
========================================================================
- Coverage 85.009% 84.864% -0.145%
========================================================================
Files 486 486
Lines 28965 29025 +60
Branches 12610 12620 +10
========================================================================
+ Hits 24623 24632 +9
- Misses 4293 4344 +51
Partials 49 49
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
5f57b05 to
a4f221a
Compare
0d2b4c1 to
3547546
Compare
a4f221a to
fde4a5e
Compare
3547546 to
e7c5abb
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| [self captureRequestDetails:sessionTask | ||
| networkCaptureBodies:options.sessionReplay.networkCaptureBodies | ||
| networkRequestHeaders:options.sessionReplay.networkRequestHeaders]; | ||
| } |
There was a problem hiding this comment.
Request details captured before bytes are sent
Medium Severity
captureRequestDetails is called in urlSessionTask:setState: for every state transition, and its associated-object guard ensures only the first call takes effect. Since the setState: swizzle runs before the original, the first invocation occurs on the Running transition when countOfBytesSent is still 0. The countOfBytesSent > 0 branch is effectively dead code — request size always falls back to bodyData.length, which is often nil for stream-based uploads.
Additional Locations (1)
fde4a5e to
8b6853c
Compare
e7c5abb to
2e9607e
Compare
2e9607e to
6e5c5bb
Compare
8b6853c to
624e1f5
Compare
🚨 Detected changes in high risk code 🚨High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:
|


📜 Description
Hook the network details implementation into SentryNetworkTracker by implementing the 2 entrypoints
💡 Motivation and Context
This PR updates SentryNetworkTracker to call into extraction logic introduced in previous PRs.
💚 How did you test it?
See other PRs for tests.
📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled. requires SDKOptions config (networkDetailAllowUrls)Closes #7589