Repository navigation
iOS: Session Replay network-detail capture breaks requests on sentry-cocoa 9.25.0 #6609
Description
Summary
After bumping sentry-cocoa 9.24.0 → 9.26.0 (#6409), the iOS E2E flow captureSpaceflightNewsScreenTransaction.test.ios.auto began failing deterministically on main and every PR. The flow fails at No visible element found: "Load More Articles" because the article fetch never completes, so the list never renders.
Root cause is in sentry-cocoa 9.26.0, not in RN JS/bridge code: with 9.26.0, an outbound URLSession request to a URL on the Session Replay network-detail allow-list (with body capture enabled) does not complete. This is a functional networking regression, not just telemetry loss.
Why this matters (user impact)
Any app on sentry-cocoa 9.26.0 using Session Replay with networkDetailAllowUrls + networkCaptureBodies will have its requests to those hosts broken. Bounded to allow-listed network-detail URLs; other traffic is unaffected. In @sentry/react-native this surfaces on iOS because the native SDK performs the URLSession instrumentation.
Evidence — three-way E2E bisect (single variable each)
The sample's mobileReplayIntegration in samples/react-native/src/App.tsx configures network-detail capture for exactly the failing host:
Sentry.mobileReplayIntegration({
networkDetailAllowUrls: ['https://api.spaceflightnewsapi.net'],
networkCaptureBodies: true,
})| sentry-cocoa | Replay network-detail capture | Spaceflight iOS flow | CI run |
|---|---|---|---|
| 9.26.0 | on | ❌ red (4/4 deterministic) | 32713642451 |
| 9.24.0 | on | ✅ green | 32722276675 |
| 9.26.0 | off | ✅ green | 32725506585 |
Two independent single-variable flips each turn it green → the trigger is 9.26.0's Session Replay network-detail path. It is the only iOS flow making a real external HTTP request, and the only one that failed; all other iOS flows passed in every run.
Suspected upstream cause (to pass to sentry-cocoa)
getsentry/sentry-cocoa#8497 — "Prevent Session Replay network-detail breadcrumbs from blocking URLSession cancellation on the task monitor" — the only 9.26.0 change touching both the network-detail path and URLSession lifecycle.
Ruled out: getsentry/sentry-cocoa#8650 (trace-header copy-and-replace setter) — not gated on replay network-detail, so disabling network-detail would not have fixed it. Last-known-good is 9.24.0 (9.25.0 shipped no networking changes per the cocoa changelog).
Verification for the cocoa team: revert #8497 on a 9.26.0 build (or bisect 9.25.0→9.26.0) against the repro below.
Reproduction
@sentry/react-nativeon iOS with sentry-cocoa 9.26.0, Session Replay enabled.- Configure
mobileReplayIntegrationwithnetworkDetailAllowUrls: ['<host>']andnetworkCaptureBodies: true. - From the app, issue a
GETto a URL on that host (e.g.https://api.spaceflightnewsapi.net/v4/articles). - Observe: the request does not complete; the response body never reaches the app. Deterministic.
Current state / workaround
- Interim options: hold the RN cocoa pin at 9.24.0, or (for users) disable
networkCaptureBodies/ drop affected hosts fromnetworkDetailAllowUrlson 9.26.0. - A proof branch demonstrating the third bisect row (removes the two options from the sample; iOS E2E green on 9.26.0) was used to isolate this and has been closed — it was a reproduction, not a merge candidate.
Next steps
- File/track the upstream sentry-cocoa issue (suspected #8497) — this ticket is the reference.
- Once cocoa ships the fix, re-apply the 9.26.0 bump and restore the network-detail options in the sample.
- Watch for cold-start flakiness on re-land and re-add a readiness gate if needed.
Activity
linear-code commentedon Aug 24, 2026
RN-741
antonis commentedon Aug 25, 2026
Update — corrected bisect: the regression is in 9.25.0, not 9.26.0, and the trigger is the Objective-C → Swift port of
SentryNetworkTracker(getsentry/sentry-cocoa#8502).Running the bisect one version finer overturns the conclusion in the original write-up above.
No visible element: "Load More Articles", 29 s, healthy driver32842965136, job9780344432432855896390, job97831246365So 9.25.0 is already broken — the earlier note that "9.25.0 shipped no networking changes per the cocoa changelog" is incorrect. The
9.24.0 → 9.25.0range contains the network-tracker rewrite:SentryNetworkTrackerto Swift — deletesSentryNetworkTracker.m(776 lines), addsSentryNetworkTracker.swift(675 lines) plus a newURLSessionTask+AssociatedValues.swift. This is exactly the delegate-path code RN'sRCTHTTPRequestHandlerexercises (urlSessionTask:setState:→captureRequestDetails).Revised suspect: #8502, not #8497. #8497 ("avoid URLSession task monitor contention") landed in 9.26.0 — after the regression already existed in 9.25.0 — and only modifies the
dataTask(with:completionHandler:)path, which RN's delegate-based networking never takes. For the same reason, getsentry/sentry-cocoa#8852 cannot fix the RN path.New symptom detail: on-device this is a native crash, not just a stalled request. Opening the Spaceflight News screen in the sample crashes the app. In the 9.25.0 Swift port, per-task state (span, start date, breadcrumb flag, and the Replay
networkDetails) is stored on theURLSessionTaskvia associated objects (AssociatedObjectAccessorin the newURLSessionTask+AssociatedValues.swift) and read back from thesetState:swizzle. Associated-object storage onNSURLSessionTask(a class-cluster type, wrapped by the KVO/swizzle dynamic subclass) is a known native-crash surface and is new in #8502 — leading suspect for the crash. A captured crash report is available internally.For the cocoa team: bisect
9.24.0 → 9.25.0(not 9.25.0 → 9.26.0) and focus on #8502. Last-known-good remains 9.24.0.[-]iOS: Session Replay network-detail capture breaks requests on sentry-cocoa 9.26.0 (Spaceflight E2E regression)[/-][+]iOS: Session Replay network-detail capture breaks requests on sentry-cocoa 9.25.0[/+]antonis commentedon Aug 26, 2026
Sentry report https://sentry-sdks.sentry.io/issues/7691603909/events/latest/?project=5428561&query=is%3Aunresolved&referrer=latest-event
fix(ios): Revert to -force_load for Sentry categories (-ObjC regressed)
fix(ios): Stay on Cocoa SDK 9.24.0 (revert 9.26.0 bump) (#6622)
fix(ios): Force-load the Sentry static archive to keep ObjC category …
ci(ios): Assert Sentry ObjC categories survive the SwiftPM link
ci(ios): Fail the category check when the Sentry archive is missing
feat(ios): Support SPM autolinking (#6784)