feat: Add network details for session replay on iOS #4891
2 issues
find-bugs: Found 2 issues (2 high)
High
ToCocoaBreadcrumbData is never called, iOS Session Replay network details will not work - `src/Sentry/Platforms/Cocoa/Extensions/CocoaExtensions.cs:198-227`
The new ToCocoaBreadcrumbData method is created to convert request_start to NSDate for iOS Session Replay (as referenced in the comment linking to sentry-cocoa), but it is never wired up. The BreadcrumbExtensions.ToCocoaBreadcrumb method (in BreadcrumbExtensions.cs line 22) still calls ToNullableNSDictionary() instead of the new ToCocoaBreadcrumbData(). This means HTTP breadcrumb data will continue to store request_start as a string instead of an NSDate, and the network tab in iOS Session Replay will not show the outbound HTTP requests as intended by this PR.
Duplicate test methods will cause compiler error on Android - `test/Sentry.Tests/SentryHttpMessageHandlerTests.cs:617-667`
The new test methods HandleResponse_SpanExists_AddsReplayBreadcrumbData and HandleResponse_NoSpanExists_NoReplayBreadcrumbData are defined inside #if ANDROID || IOS || MACCATALYST block (lines 617-692). However, identical method names already exist in the #if ANDROID block (lines 696-765). When building for Android, both conditional blocks are active, resulting in duplicate method definitions that will fail compilation.
Duration: 2m 11s · Tokens: 505.7k in / 8.5k out · Cost: $0.96 (+extraction: $0.00, +merge: $0.00)
Annotations
Check failure on line 227 in src/Sentry/Platforms/Cocoa/Extensions/CocoaExtensions.cs
sentry-warden / warden: find-bugs
ToCocoaBreadcrumbData is never called, iOS Session Replay network details will not work
The new `ToCocoaBreadcrumbData` method is created to convert `request_start` to `NSDate` for iOS Session Replay (as referenced in the comment linking to sentry-cocoa), but it is never wired up. The `BreadcrumbExtensions.ToCocoaBreadcrumb` method (in BreadcrumbExtensions.cs line 22) still calls `ToNullableNSDictionary()` instead of the new `ToCocoaBreadcrumbData()`. This means HTTP breadcrumb data will continue to store `request_start` as a string instead of an `NSDate`, and the network tab in iOS Session Replay will not show the outbound HTTP requests as intended by this PR.
Check failure on line 667 in test/Sentry.Tests/SentryHttpMessageHandlerTests.cs
sentry-warden / warden: find-bugs
Duplicate test methods will cause compiler error on Android
The new test methods `HandleResponse_SpanExists_AddsReplayBreadcrumbData` and `HandleResponse_NoSpanExists_NoReplayBreadcrumbData` are defined inside `#if ANDROID || IOS || MACCATALYST` block (lines 617-692). However, identical method names already exist in the `#if ANDROID` block (lines 696-765). When building for Android, both conditional blocks are active, resulting in duplicate method definitions that will fail compilation.