Skip to content

Merge branch 'main' into ios-performance-spans

b49f55d
Select commit
Loading
Failed to load commit list.
Open

feat: Add network details for session replay on iOS #4891

Merge branch 'main' into ios-performance-spans
b49f55d
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden completed Mar 17, 2026 in 2m 19s

4 issues

High

NSDictionary indexer assignment will fail at runtime - NSDictionary is immutable - `src/Sentry/Platforms/Cocoa/Extensions/CocoaExtensions.cs:207-220`

The code creates an NSDictionary<NSString, NSObject> on line 207 and then tries to assign values using the indexer (dict[key] = value) on lines 216 and 220. In .NET iOS/Mac bindings, NSDictionary is immutable and does not support indexer assignment - this will throw a runtime exception. The existing pattern in this file (see ToNSDictionary() at lines 166-169) correctly uses an intermediate .NET Dictionary<> and then converts using NSDictionary.FromObjectsAndKeys().

Duplicate test method definitions will cause compile error on Android - `test/Sentry.Tests/SentryHttpMessageHandlerTests.cs:617-692`

The test methods HandleResponse_SpanExists_AddsReplayBreadcrumbData and HandleResponse_NoSpanExists_NoReplayBreadcrumbData are defined twice: once in the #if ANDROID || IOS || MACCATALYST block (lines 618-692) and again in the #if ANDROID block (lines 697-765 in context after). When compiling for ANDROID, both preprocessor conditions are true, resulting in duplicate method definitions that will cause a compilation error.

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.

4 skills analyzed
Skill Findings Duration Cost
code-review 2 2m 3s $1.00
find-bugs 2 2m 11s $0.96
gha-security-review 0 49.0s $0.22
security-review 0 1m 26s $0.37

Duration: 6m 29s · Tokens: 1.6M in / 20.4k out · Cost: $2.55 (+merge: $0.00, +fix_gate: $0.00, +extraction: $0.00, +dedup: $0.00)