Skip to content

Commit cdf2f33

Browse files
authored
Use cached methods SentryDebugImageProvider of the Cocoa SDK (#4194)
* Updates sentry-cocoa to 8.39.0-beta.1 * Replaces getDebugImagesForAddresses:isCrash: with getDebugImagesForImageAddressesFromCache * Updates changelog * Updates sentry-cocoa to 8.39.0 * Remove private function declaration
1 parent f9c38c7 commit cdf2f33

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
- Skips ignoring require cycle logs for RN 0.70 or newer ([#4214](https://github.com/getsentry/sentry-react-native/pull/4214))
3636
- Enhanced accuracy of time-to-display spans. ([#4189](https://github.com/getsentry/sentry-react-native/pull/4189))
37+
- Speed up getBinaryImages for finishing transactions and capturing events ([#4194](https://github.com/getsentry/sentry-react-native/pull/4194))
3738

3839
### Features
3940

packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.mm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#import "RNSentryTests.h"
22
#import <OCMock/OCMock.h>
33
#import <RNSentry/RNSentry.h>
4+
#import <Sentry/SentryDebugImageProvider+HybridSDKs.h>
45
#import <UIKit/UIKit.h>
56
#import <XCTest/XCTest.h>
67

@@ -327,9 +328,9 @@ - (void)prepareNativeFrameMocksWithLocalSymbolication:(BOOL)debug
327328
OCMStub([sentryDebugImageMock serialize]).andReturn(serializedDebugImage);
328329

329330
id sentryDebugImageProviderMock = OCMClassMock([SentryDebugImageProvider class]);
330-
OCMStub([sentryDebugImageProviderMock
331-
getDebugImagesForAddresses:[NSSet setWithObject:@"0x000000000001b669"]
332-
isCrash:false])
331+
OCMStub(
332+
[sentryDebugImageProviderMock
333+
getDebugImagesForImageAddressesFromCache:[NSSet setWithObject:@"0x000000000001b669"]])
333334
.andReturn(@[ sentryDebugImageMock ]);
334335

335336
OCMStub([sentryDependencyContainerMock debugImageProvider])

packages/core/ios/RNSentry.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313

1414
typedef int (*SymbolicateCallbackType)(const void *, Dl_info *);
1515

16-
@interface
17-
SentryDebugImageProvider ()
18-
- (NSArray<SentryDebugMeta *> *_Nonnull)getDebugImagesForAddresses:
19-
(NSSet<NSString *> *_Nonnull)addresses
20-
isCrash:(BOOL)isCrash;
21-
@end
22-
2316
@interface
2417
SentrySDK (Private)
2518
@property (nonatomic, nullable, readonly, class) SentryOptions *options;

packages/core/ios/RNSentry.mm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#import <Sentry/PrivateSentrySDKOnly.h>
2222
#import <Sentry/SentryAppStartMeasurement.h>
2323
#import <Sentry/SentryBinaryImageCache.h>
24+
#import <Sentry/SentryDebugImageProvider+HybridSDKs.h>
2425
#import <Sentry/SentryDependencyContainer.h>
2526
#import <Sentry/SentryFormatter.h>
2627
#import <Sentry/SentryOptions+HybridSDKs.h>
@@ -368,9 +369,9 @@ - (NSDictionary *)fetchNativeStackFramesBy:(NSArray<NSNumber *> *)instructionsAd
368369
NSMutableArray<NSDictionary<NSString *, id> *> *_Nonnull serializedDebugMetaImages =
369370
[[NSMutableArray alloc] init];
370371

371-
NSArray<SentryDebugMeta *> *debugMetaImages = [[[SentryDependencyContainer sharedInstance]
372-
debugImageProvider] getDebugImagesForAddresses:imagesAddrToRetrieveDebugMetaImages
373-
isCrash:false];
372+
NSArray<SentryDebugMeta *> *debugMetaImages =
373+
[[[SentryDependencyContainer sharedInstance] debugImageProvider]
374+
getDebugImagesForImageAddressesFromCache:imagesAddrToRetrieveDebugMetaImages];
374375

375376
for (SentryDebugMeta *debugImage in debugMetaImages) {
376377
[serializedDebugMetaImages addObject:[debugImage serialize]];

0 commit comments

Comments
 (0)