feat: Add network details for session replay on iOS #4891
2 issues
code-review: Found 2 issues (2 high)
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.
Duration: 2m 3s · Tokens: 697.8k in / 8.4k out · Cost: $1.01 (+merge: $0.00, +fix_gate: $0.00)
Annotations
Check failure on line 220 in src/Sentry/Platforms/Cocoa/Extensions/CocoaExtensions.cs
sentry-warden / warden: code-review
NSDictionary indexer assignment will fail at runtime - NSDictionary is immutable
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()`.
Check failure on line 692 in test/Sentry.Tests/SentryHttpMessageHandlerTests.cs
sentry-warden / warden: code-review
Duplicate test method definitions will cause compile error on Android
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.