Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,16 @@ - (void)prepareNativeFrameMocksWithLocalSymbolication:(BOOL)debug
OCMStub([sentryBinaryImageCacheMock imageByAddress:[@456 unsignedLongLongValue]])
.andReturn(sentryBinaryImageInfoMockTwo);

NSDictionary *serializedDebugImage = @{
@"uuid" : @"mockuuid",
@"debug_id" : @"mockdebugid",
@"type" : @"macho",
@"image_addr" : @"0x000000000001b669",
};
id sentryDebugImageMock = OCMClassMock([SentryDebugMeta class]);
OCMStub([sentryDebugImageMock serialize]).andReturn(serializedDebugImage);
SentryDebugMeta *sentryDebugImage = [[SentryDebugMeta alloc] init];
sentryDebugImage.debugID = @"mockdebugid";
sentryDebugImage.type = @"macho";
sentryDebugImage.imageAddress = @"0x000000000001b669";

id sentryDebugImageProviderMock = OCMClassMock([SentryDebugImageProvider class]);
OCMStub(
[sentryDebugImageProviderMock
getDebugImagesForImageAddressesFromCache:[NSSet setWithObject:@"0x000000000001b669"]])
.andReturn(@[ sentryDebugImageMock ]);
.andReturn(@[ sentryDebugImage ]);

OCMStub([sentryDependencyContainerMock debugImageProvider])
.andReturn(sentryDebugImageProviderMock);
Expand All @@ -123,7 +119,6 @@ - (void)testFetchNativeStackFramesByInstructionsServerSymbolication
NSDictionary *expected = @{
@"debugMetaImages" : @[
@{
@"uuid" : @"mockuuid",
@"debug_id" : @"mockdebugid",
@"type" : @"macho",
@"image_addr" : @"0x000000000001b669",
Expand Down
3 changes: 2 additions & 1 deletion packages/core/ios/RNSentry+fetchNativeStack.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#import "RNSentryBreadcrumb.h"
#import "RNSentryHexFormatter.h"
#import "RNSentryId.h"
#import "RNSentrySwiftBridge.h"
#import "SentrySDKWrapper.h"
@import Sentry;

Expand Down Expand Up @@ -75,7 +76,7 @@ - (NSDictionary *)fetchNativeStackFramesBy:(NSArray<NSNumber *> *)instructionsAd
getDebugImagesForImageAddressesFromCache:imagesAddrToRetrieveDebugMetaImages];

for (SentryDebugMeta *debugImage in debugMetaImages) {
[serializedDebugMetaImages addObject:[debugImage serialize]];
[serializedDebugMetaImages addObject:[RNSentryInternal serializeDebugMeta:debugImage]];
}

return @{
Expand Down
4 changes: 2 additions & 2 deletions packages/core/ios/RNSentry.mm
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@

[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) {
// Serialize to get contexts dictionary
NSDictionary *serializedScope = [scope serialize];
NSDictionary *serializedScope = [RNSentryInternalWrapper serializeScope:scope];

Check failure on line 447 in packages/core/ios/RNSentry.mm

View check run for this annotation

@sentry/warden / warden: code-review

Pinned Cocoa version lacks the new internal serializer APIs

Update the bundled sentry-cocoa version before building this change. The Swift bridge calls internal scope and debug-meta serializer APIs that are not available in the pinned 9.30.2 dependency, so native builds will fail until the dependency provides them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinned Cocoa version lacks the new internal serializer APIs

Update the bundled sentry-cocoa version before building this change. The Swift bridge calls internal scope and debug-meta serializer APIs that are not available in the pinned 9.30.2 dependency, so native builds will fail until the dependency provides them.

Evidence
  • RNSentry.mm calls RNSentryInternalWrapper.serializeScope; the wrapper forwards to RNSentryInternal.serializeScope, which calls SentrySDK.internal.serializer.serialize(scope:).
  • RNSentry+fetchNativeStack.m also calls the new debug-meta serializer through RNSentryInternal.serializeDebugMeta.
  • RNSentry.podspec and Package.swift both pin sentry-cocoa to 9.30.2.
  • The PR context says these serializer APIs require a Cocoa release that has not yet been added to the bundled dependency, leaving the Swift bridge without the APIs it references at build time.
Also found at 1 additional location
  • packages/core/ios/Swift/RNSentryInternal.swift:100-106

Identified by Warden 路 code-review 路 ESP-4NA

NSDictionary *allContexts = serializedScope[@"context"]; // It's singular here, annoyingly

NSMutableDictionary *contexts = [NSMutableDictionary new];
Expand Down Expand Up @@ -496,7 +496,7 @@
}
__block NSMutableDictionary<NSString *, id> *serializedScope;
[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) {
serializedScope = [[scope serialize] mutableCopy];
serializedScope = [[RNSentryInternalWrapper serializeScope:scope] mutableCopy];

NSDictionary<NSString *, id> *user = [serializedScope valueForKey:@"user"];
if (user == nil) {
Expand Down
5 changes: 5 additions & 0 deletions packages/core/ios/RNSentryInternalWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

@class SentryEnvelope;
@class SentryId;
@class SentryScope;

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -40,6 +41,10 @@

@property (class, readonly) BOOL isFramesTrackingRunning;

// MARK: - Serialization

+ (NSDictionary<NSString *, id> *)serializeScope:(SentryScope *)scope;

Check failure on line 46 in packages/core/ios/RNSentryInternalWrapper.h

View check run for this annotation

@sentry/warden / warden: find-bugs

iOS builds use Cocoa serializer APIs newer than the pinned dependency

The new Swift bridge calls Cocoa鈥檚 internal scope serializer, but both Cocoa dependency declarations still pin 9.30.2. Native builds against that version will fail to compile. Bump the bundled Cocoa version to a release that provides the serializer API before merging.

// MARK: - Envelopes

+ (nullable SentryEnvelope *)envelopeFromData:(nullable NSData *)data;
Expand Down
7 changes: 7 additions & 0 deletions packages/core/ios/RNSentryInternalWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ + (BOOL)isFramesTrackingRunning
return RNSentryInternal.isFramesTrackingRunning;
}

// MARK: - Serialization

+ (NSDictionary<NSString *, id> *)serializeScope:(SentryScope *)scope
{
return [RNSentryInternal serializeScope:scope];
}

// MARK: - Envelopes

+ (SentryEnvelope *)envelopeFromData:(NSData *)data
Expand Down
10 changes: 10 additions & 0 deletions packages/core/ios/Swift/RNSentryInternal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@
// stub on macOS/watchOS.
#endif

// MARK: - Serialization

@_spi(Private) @objc public static func serializeScope(_ scope: Scope) -> [String: Any] {
SentrySDK.internal.serializer.serialize(scope: scope)

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / iOS Size Analysis

cannot convert value of type 'Scope' to expected argument type 'Event'

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / iOS Size Analysis

incorrect argument label in call (have 'scope:', expected 'event:')

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build ios production no-frameworks

cannot convert value of type 'Scope' to expected argument type 'Event'

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build ios production no-frameworks

incorrect argument label in call (have 'scope:', expected 'event:')

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new tvos production

cannot convert value of type 'Scope' to expected argument type 'Event'

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new tvos production

incorrect argument label in call (have 'scope:', expected 'event:')

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build legacy macos production

cannot convert value of type 'Scope' to expected argument type 'Event'

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build legacy macos production

incorrect argument label in call (have 'scope:', expected 'event:')

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new visionos production

cannot convert value of type 'Scope' to expected argument type 'Event'

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new visionos production

incorrect argument label in call (have 'scope:', expected 'event:')

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new ios dev no-frameworks

cannot convert value of type 'Scope' to expected argument type 'Event'

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new ios dev no-frameworks

incorrect argument label in call (have 'scope:', expected 'event:')

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build ios production dynamic-frameworks

cannot convert value of type 'Scope' to expected argument type 'Event'

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build ios production dynamic-frameworks

incorrect argument label in call (have 'scope:', expected 'event:')

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new ios production no-frameworks

cannot convert value of type 'Scope' to expected argument type 'Event'

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new ios production no-frameworks

incorrect argument label in call (have 'scope:', expected 'event:')

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new catalyst production

cannot convert value of type 'Scope' to expected argument type 'Event'

Check failure on line 101 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new catalyst production

incorrect argument label in call (have 'scope:', expected 'event:')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check the failure errors that are showing here ? https://github.com/getsentry/sentry-react-native/pull/6917/changes

}

@_spi(Private) @objc public static func serializeDebugMeta(_ debugMeta: DebugMeta) -> [String: Any] {
SentrySDK.internal.serializer.serialize(debugMeta: debugMeta)

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View check run for this annotation

@sentry/warden / warden: find-bugs

[G7V-V4W] iOS builds use Cocoa serializer APIs newer than the pinned dependency (additional location)

The new Swift bridge calls Cocoa鈥檚 internal scope serializer, but both Cocoa dependency declarations still pin 9.30.2. Native builds against that version will fail to compile. Bump the bundled Cocoa version to a release that provides the serializer API before merging.

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / iOS Size Analysis

cannot convert value of type 'DebugMeta' to expected argument type 'Event'

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / iOS Size Analysis

incorrect argument label in call (have 'debugMeta:', expected 'event:')

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build ios production no-frameworks

cannot convert value of type 'DebugMeta' to expected argument type 'Event'

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build ios production no-frameworks

incorrect argument label in call (have 'debugMeta:', expected 'event:')

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new tvos production

cannot convert value of type 'DebugMeta' to expected argument type 'Event'

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new tvos production

incorrect argument label in call (have 'debugMeta:', expected 'event:')

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build legacy macos production

cannot convert value of type 'DebugMeta' to expected argument type 'Event'

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build legacy macos production

incorrect argument label in call (have 'debugMeta:', expected 'event:')

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new visionos production

cannot convert value of type 'DebugMeta' to expected argument type 'Event'

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new visionos production

incorrect argument label in call (have 'debugMeta:', expected 'event:')

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new ios dev no-frameworks

cannot convert value of type 'DebugMeta' to expected argument type 'Event'

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new ios dev no-frameworks

incorrect argument label in call (have 'debugMeta:', expected 'event:')

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build ios production dynamic-frameworks

cannot convert value of type 'DebugMeta' to expected argument type 'Event'

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build ios production dynamic-frameworks

incorrect argument label in call (have 'debugMeta:', expected 'event:')

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new ios production no-frameworks

cannot convert value of type 'DebugMeta' to expected argument type 'Event'

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new ios production no-frameworks

incorrect argument label in call (have 'debugMeta:', expected 'event:')

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new catalyst production

cannot convert value of type 'DebugMeta' to expected argument type 'Event'

Check failure on line 105 in packages/core/ios/Swift/RNSentryInternal.swift

View workflow job for this annotation

GitHub Actions / Build new catalyst production

incorrect argument label in call (have 'debugMeta:', expected 'event:')
}

Check failure on line 106 in packages/core/ios/Swift/RNSentryInternal.swift

View check run for this annotation

@sentry/warden / warden: code-review

[ESP-4NA] Pinned Cocoa version lacks the new internal serializer APIs (additional location)

Update the bundled sentry-cocoa version before building this change. The Swift bridge calls internal scope and debug-meta serializer APIs that are not available in the pinned 9.30.2 dependency, so native builds will fail until the dependency provides them.

// MARK: - Envelope

// Accepts `Data?` (nil-safe) rather than `Data` so the ObjC bridge boundary
Expand Down
Loading