Skip to content

Commit

Permalink
Merge pull request #909 from bugsnag/release-v6.2.6
Browse files Browse the repository at this point in the history
Release v6.2.6
  • Loading branch information
nickdowell authored Nov 25, 2020
2 parents 86de8c6 + 11c2c53 commit d6509bf
Show file tree
Hide file tree
Showing 48 changed files with 631 additions and 490 deletions.
4 changes: 2 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ steps:
command:
- "--app=/app/build/iOSTestApp.ipa"
- "--farm=bs"
- "--device=IOS_11"
- "--device=IOS_11_0_IPHONE_8_PLUS"
- "--username=$BROWSER_STACK_USERNAME"
- "--access-key=$BROWSER_STACK_ACCESS_KEY"
- "--resilient"
- "--appium-version=1.15.0"
- "--appium-version=1.16.0"
- "--fail-fast"
concurrency: 10
concurrency_group: browserstack-app
Expand Down
4 changes: 2 additions & 2 deletions Bugsnag.podspec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Bugsnag",
"version": "6.2.5",
"version": "6.2.6",
"summary": "The Bugsnag crash reporting framework for Apple platforms.",
"homepage": "https://bugsnag.com",
"license": "MIT",
Expand All @@ -9,7 +9,7 @@
},
"source": {
"git": "https://github.com/bugsnag/bugsnag-cocoa.git",
"tag": "v6.2.5"
"tag": "v6.2.6"
},
"frameworks": [
"Foundation",
Expand Down
22 changes: 22 additions & 0 deletions Bugsnag.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,17 @@
00AD1F302486A17900A27979 /* BugsnagSessionTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 00AD1F012486A17900A27979 /* BugsnagSessionTracker.m */; };
00AD1F312486A17900A27979 /* BugsnagSessionTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 00AD1F012486A17900A27979 /* BugsnagSessionTracker.m */; };
00E636C224878D84006CBF1A /* BSG_RFC3339DateTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 008969142486DAD000DC48C2 /* BSG_RFC3339DateTool.m */; };
014475FD2566844F0018AB94 /* BugsnagApiClientTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CB9103632502320A00E9D1E2 /* BugsnagApiClientTest.m */; };
01447605256684500018AB94 /* BugsnagApiClientTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CB9103632502320A00E9D1E2 /* BugsnagApiClientTest.m */; };
01B14C56251CE55F00118748 /* report-react-native-promise-rejection.json in Resources */ = {isa = PBXBuildFile; fileRef = 01B14C55251CE55F00118748 /* report-react-native-promise-rejection.json */; };
01B14C57251CE55F00118748 /* report-react-native-promise-rejection.json in Resources */ = {isa = PBXBuildFile; fileRef = 01B14C55251CE55F00118748 /* report-react-native-promise-rejection.json */; };
01B14C58251CE55F00118748 /* report-react-native-promise-rejection.json in Resources */ = {isa = PBXBuildFile; fileRef = 01B14C55251CE55F00118748 /* report-react-native-promise-rejection.json */; };
01C17AE72542ED7F00C102C9 /* KSCrashReportWriterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 01C17AE62542ED7F00C102C9 /* KSCrashReportWriterTests.m */; };
01C17AE82542ED7F00C102C9 /* KSCrashReportWriterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 01C17AE62542ED7F00C102C9 /* KSCrashReportWriterTests.m */; };
01C17AE92542ED7F00C102C9 /* KSCrashReportWriterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 01C17AE62542ED7F00C102C9 /* KSCrashReportWriterTests.m */; };
01E8765E256684E700F4B70A /* URLSessionMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 01E8765D256684E700F4B70A /* URLSessionMock.m */; };
01E8765F256684E700F4B70A /* URLSessionMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 01E8765D256684E700F4B70A /* URLSessionMock.m */; };
01E87660256684E700F4B70A /* URLSessionMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 01E8765D256684E700F4B70A /* URLSessionMock.m */; };
3A700A9424A63ABC0068CD1B /* BugsnagThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A700A8024A63A8E0068CD1B /* BugsnagThread.h */; settings = {ATTRIBUTES = (Public, ); }; };
3A700A9524A63AC50068CD1B /* BugsnagSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A700A8124A63A8E0068CD1B /* BugsnagSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
3A700A9624A63AC60068CD1B /* BugsnagStackframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A700A8224A63A8E0068CD1B /* BugsnagStackframe.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -1274,8 +1279,14 @@
00E636C02487031D006CBF1A /* Bugsnag.podspec.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = Bugsnag.podspec.json; sourceTree = SOURCE_ROOT; };
00E636C12487031D006CBF1A /* docker-compose.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = "docker-compose.yml"; sourceTree = SOURCE_ROOT; };
00E636C324878FFC006CBF1A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0134524A256BCF7C0088C548 /* BugsnagError+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagError+Private.h"; sourceTree = "<group>"; };
0134524B256BD00A0088C548 /* BugsnagThread+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagThread+Private.h"; sourceTree = "<group>"; };
0195FC3B256BC81400DE6646 /* BugsnagEvent+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagEvent+Private.h"; sourceTree = "<group>"; };
0198762E2567D5AB000A7AF3 /* BugsnagStackframe+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagStackframe+Private.h"; sourceTree = "<group>"; };
01B14C55251CE55F00118748 /* report-react-native-promise-rejection.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "report-react-native-promise-rejection.json"; sourceTree = "<group>"; };
01C17AE62542ED7F00C102C9 /* KSCrashReportWriterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KSCrashReportWriterTests.m; sourceTree = "<group>"; };
01E8765C256684E700F4B70A /* URLSessionMock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = URLSessionMock.h; sourceTree = "<group>"; };
01E8765D256684E700F4B70A /* URLSessionMock.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = URLSessionMock.m; sourceTree = "<group>"; };
3A700A8024A63A8E0068CD1B /* BugsnagThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagThread.h; sourceTree = "<group>"; };
3A700A8124A63A8E0068CD1B /* BugsnagSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagSession.h; sourceTree = "<group>"; };
3A700A8224A63A8E0068CD1B /* BugsnagStackframe.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagStackframe.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1693,6 +1704,8 @@
008966AE2486D43500DC48C2 /* Swift Tests */,
CBA22499251E429C00B87416 /* TestSupport.h */,
CBA2249A251E429C00B87416 /* TestSupport.m */,
01E8765C256684E700F4B70A /* URLSessionMock.h */,
01E8765D256684E700F4B70A /* URLSessionMock.m */,
);
path = Tests;
sourceTree = "<group>";
Expand Down Expand Up @@ -1785,7 +1798,9 @@
008968482486DA9400DC48C2 /* BugsnagDevice.m */,
0089685A2486DA9500DC48C2 /* BugsnagDeviceWithState.m */,
008968512486DA9400DC48C2 /* BugsnagError.m */,
0134524A256BCF7C0088C548 /* BugsnagError+Private.h */,
008968462486DA9300DC48C2 /* BugsnagEvent.m */,
0195FC3B256BC81400DE6646 /* BugsnagEvent+Private.h */,
0089684E2486DA9400DC48C2 /* BugsnagHandledState.h */,
008968522486DA9400DC48C2 /* BugsnagHandledState.m */,
008968622486DA9500DC48C2 /* BugsnagNotifier.h */,
Expand All @@ -1795,11 +1810,13 @@
008968562486DA9400DC48C2 /* BugsnagSessionTrackingPayload.h */,
008968542486DA9400DC48C2 /* BugsnagSessionTrackingPayload.m */,
008968532486DA9400DC48C2 /* BugsnagStackframe.m */,
0198762E2567D5AB000A7AF3 /* BugsnagStackframe+Private.h */,
0089684F2486DA9400DC48C2 /* BugsnagStacktrace.h */,
0089685C2486DA9500DC48C2 /* BugsnagStacktrace.m */,
008968552486DA9400DC48C2 /* BugsnagStateEvent.h */,
008968582486DA9500DC48C2 /* BugsnagStateEvent.m */,
008968612486DA9500DC48C2 /* BugsnagThread.m */,
0134524B256BD00A0088C548 /* BugsnagThread+Private.h */,
0089685F2486DA9500DC48C2 /* BugsnagUser.m */,
);
path = Payload;
Expand Down Expand Up @@ -2581,6 +2598,7 @@
008967542486D43700DC48C2 /* BugsnagOnCrashTest.m in Sources */,
008966F72486D43700DC48C2 /* RegisterErrorDataTest.m in Sources */,
008967152486D43700DC48C2 /* BugsnagCollectionsBSGDictMergeTest.m in Sources */,
01E8765E256684E700F4B70A /* URLSessionMock.m in Sources */,
008967632486D43700DC48C2 /* BugsnagCollectionsBSGDictSetSafeObjectTest.m in Sources */,
008967AB2486D43700DC48C2 /* KSMach_Tests.m in Sources */,
0089672A2486D43700DC48C2 /* BugsnagStacktraceTest.m in Sources */,
Expand Down Expand Up @@ -2708,6 +2726,7 @@
008967132486D43700DC48C2 /* BugsnagEventTests.m in Sources */,
0089675B2486D43700DC48C2 /* BugsnagEnabledBreadcrumbTest.m in Sources */,
008966EC2486D43700DC48C2 /* BugsnagDeviceTest.m in Sources */,
014475FD2566844F0018AB94 /* BugsnagApiClientTest.m in Sources */,
008967462486D43700DC48C2 /* BugsnagTests.m in Sources */,
008967A62486D43700DC48C2 /* KSString_Tests.m in Sources */,
004E353D2487B3B8007FBAE4 /* BugsnagSwiftTests.swift in Sources */,
Expand Down Expand Up @@ -2750,6 +2769,7 @@
008967432486D43700DC48C2 /* BugsnagSessionTrackerStopTest.m in Sources */,
008967972486D43700DC48C2 /* KSCrashState_Tests.m in Sources */,
008967762486D43700DC48C2 /* XCTestCase+KSCrash.m in Sources */,
01E8765F256684E700F4B70A /* URLSessionMock.m in Sources */,
008967312486D43700DC48C2 /* BugsnagStateEventTest.m in Sources */,
004E35362487AFF2007FBAE4 /* BugsnagHandledStateTest.m in Sources */,
01C17AE82542ED7F00C102C9 /* KSCrashReportWriterTests.m in Sources */,
Expand Down Expand Up @@ -2891,6 +2911,7 @@
0089674A2486D43700DC48C2 /* BugsnagUserTest.m in Sources */,
0089673B2486D43700DC48C2 /* BugsnagEventFromKSCrashReportTest.m in Sources */,
0089674D2486D43700DC48C2 /* BSGConnectivityTest.m in Sources */,
01E87660256684E700F4B70A /* URLSessionMock.m in Sources */,
008966F02486D43700DC48C2 /* BugsnagClientPayloadInfoTest.m in Sources */,
008967652486D43700DC48C2 /* BugsnagCollectionsBSGDictSetSafeObjectTest.m in Sources */,
E701FAA92490EF77008D842F /* ClientApiValidationTest.m in Sources */,
Expand All @@ -2915,6 +2936,7 @@
01C17AE92542ED7F00C102C9 /* KSCrashReportWriterTests.m in Sources */,
00896A422486DBDD00DC48C2 /* BSGConfigurationBuilderTests.m in Sources */,
008967682486D43700DC48C2 /* BugsnagNotifierTest.m in Sources */,
01447605256684500018AB94 /* BugsnagApiClientTest.m in Sources */,
0089676E2486D43700DC48C2 /* BugsnagTestsDummyClass.m in Sources */,
008967412486D43700DC48C2 /* BugsnagAppTest.m in Sources */,
008967052486D43700DC48C2 /* BugsnagThreadSerializationTest.m in Sources */,
Expand Down
4 changes: 0 additions & 4 deletions Bugsnag/Bugsnag.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ @interface NSDictionary (BSGKSMerge)
- (NSDictionary *)BSG_mergedInto:(NSDictionary *)dest;
@end

@interface BugsnagEvent ()
@property(readwrite) NSUInteger depth;
@end

@interface BugsnagClient ()
- (void)startListeningForStateChangeNotification:(NSString *_Nonnull)notificationName;
- (void)addBreadcrumbWithBlock:(void (^_Nonnull)(BugsnagBreadcrumb *_Nonnull))block;
Expand Down
35 changes: 14 additions & 21 deletions Bugsnag/BugsnagErrorReportSink.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
//

#import "BugsnagErrorReportSink.h"

#import "BSG_KSSystemInfo.h"
#import "Bugsnag.h"
#import "BugsnagLogger.h"
#import "BugsnagCollections.h"
#import "BugsnagClient.h"
#import "BugsnagClientInternal.h"
#import "BugsnagCollections.h"
#import "BugsnagEvent+Private.h"
#import "BugsnagKeys.h"
#import "BugsnagLogger.h"
#import "BugsnagNotifier.h"
#import "BSG_KSSystemInfo.h"
#import "Private.h"

// This is private in Bugsnag, but really we want package private so define
Expand All @@ -45,13 +47,6 @@ @interface BugsnagNotifier ()
- (NSDictionary *)toDict;
@end

@interface BugsnagEvent ()
- (NSDictionary *_Nonnull)toJson;
- (BOOL)shouldBeSent;
- (instancetype _Nonnull)initWithKSReport:(NSDictionary *_Nonnull)report;
@property NSSet<NSString *> *redactedKeys;
@end

@interface BugsnagConfiguration ()
@property(nonatomic, readwrite, strong) NSMutableArray *onSendBlocks;
- (NSDictionary *_Nonnull)errorApiHeaders;
Expand Down Expand Up @@ -92,10 +87,10 @@ - (instancetype)initWithApiClient:(BugsnagErrorReportApiClient *)apiClient {
}

- (void)finishActiveRequest:(NSString *)requestId
success:(BOOL)success
completed:(BOOL)completed
error:(NSError *)error
block:(BSGOnErrorSentBlock)block {
block(requestId, success, error);
block(requestId, completed, error);
@synchronized (self.activeRequests) {
[self.activeRequests removeObject:requestId];
}
Expand Down Expand Up @@ -123,7 +118,7 @@ - (void)sendStoredReports:(NSDictionary <NSString *, NSDictionary *> *)ksCrashRe
if ([event shouldBeSent] && [self runOnSendBlocks:configuration event:event]) {
storedEvents[fileKey] = event;
} else { // delete the report as the user has discarded it
[self finishActiveRequest:fileKey success:true error:nil block:block];
[self finishActiveRequest:fileKey completed:YES error:nil block:block];
}
}
[self deliverStoredEvents:storedEvents configuration:configuration block:block];
Expand All @@ -137,14 +132,12 @@ - (void)deliverStoredEvents:(NSMutableDictionary<NSString *, BugsnagEvent *> *)s
NSDictionary *requestPayload = [self prepareEventPayload:event];

NSMutableDictionary *apiHeaders = [[configuration errorApiHeaders] mutableCopy];
BSGDictSetSafeObject(apiHeaders, event.apiKey, BSGHeaderApiKey);
[self.apiClient sendItems:1
withPayload:requestPayload
toURL:configuration.notifyURL
headers:apiHeaders
onCompletion:^(NSUInteger reportCount, BOOL success, NSError *error) {
[self finishActiveRequest:filename success:success error:error block:block];
}];
apiHeaders[BugsnagHTTPHeaderNameApiKey] = event.apiKey;
[self.apiClient sendJSONPayload:requestPayload headers:apiHeaders toURL:configuration.notifyURL
completionHandler:^(BugsnagApiClientDeliveryStatus status, NSError *error) {
BOOL completed = status == BugsnagApiClientDeliveryStatusDelivered || status == BugsnagApiClientDeliveryStatusUndeliverable;
[self finishActiveRequest:filename completed:completed error:error block:block];
}];
}
}

Expand Down
85 changes: 28 additions & 57 deletions Bugsnag/Client/BugsnagClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,38 @@

#import "BugsnagClient.h"

#import "BugsnagBreadcrumbs.h"
#import "BugsnagClientInternal.h"
#import "BSGConnectivity.h"
#import "Bugsnag.h"
#import "Private.h"
#import "BugsnagCrashSentry.h"
#import "BugsnagHandledState.h"
#import "BugsnagLogger.h"
#import "BugsnagKeys.h"
#import "BugsnagSessionTracker.h"
#import "BugsnagSessionTrackingApiClient.h"
#import "BugsnagPluginClient.h"
#import "BugsnagSystemState.h"
#import "BSG_RFC3339DateTool.h"
#import "BSGJSONSerialization.h"
#import "BSGSerialization.h"
#import "BSG_KSCrash.h"
#import "BSG_KSCrashC.h"
#import "BSG_KSCrashType.h"
#import "BSG_KSCrashReport.h"
#import "BSG_KSCrashState.h"
#import "BSG_KSSystemInfo.h"
#import "BSG_KSCrashType.h"
#import "BSG_KSMach.h"
#import "BSGSerialization.h"
#import "BSG_KSSystemInfo.h"
#import "BSG_RFC3339DateTool.h"
#import "Bugsnag.h"
#import "Bugsnag.h"
#import "BugsnagBreadcrumbs.h"
#import "BugsnagClientInternal.h"
#import "BugsnagCollections.h"
#import "BugsnagCrashSentry.h"
#import "BugsnagError+Private.h"
#import "BugsnagErrorTypes.h"
#import "BugsnagNotifier.h"
#import "BugsnagEvent+Private.h"
#import "BugsnagHandledState.h"
#import "BugsnagKeys.h"
#import "BugsnagLogger.h"
#import "BugsnagMetadataInternal.h"
#import "BugsnagNotifier.h"
#import "BugsnagPluginClient.h"
#import "BugsnagSessionTracker.h"
#import "BugsnagSessionTrackingApiClient.h"
#import "BugsnagStateEvent.h"
#import "BugsnagCollections.h"
#import "BSG_KSCrashReport.h"
#import "BSG_KSCrash.h"
#import "BSGJSONSerialization.h"
#import "BugsnagSystemState.h"
#import "BugsnagThread+Private.h"
#import "Private.h"

#if BSG_PLATFORM_IOS || BSG_PLATFORM_TVOS
#define BSGOOMAvailable 1
Expand Down Expand Up @@ -121,10 +124,6 @@ @interface BugsnagSession ()
@property NSUInteger handledCount;
@end

@interface BugsnagThread ()
+ (NSMutableArray *)serializeThreads:(NSArray<BugsnagThread *> *)threads;
@end

@interface BugsnagAppWithState ()
+ (BugsnagAppWithState *)appWithDictionary:(NSDictionary *)event
config:(BugsnagConfiguration *)config
Expand Down Expand Up @@ -326,31 +325,6 @@ @interface BugsnagConfiguration ()
- (BOOL)shouldRecordBreadcrumbType:(BSGBreadcrumbType)type;
@end

@interface BugsnagEvent ()
@property(readonly, copy, nonnull) NSDictionary *overrides;
@property(readwrite) NSUInteger depth;
@property(readonly, nonnull) BugsnagHandledState *handledState;
@property (nonatomic, strong) BugsnagMetadata *metadata;
- (void)setOverrideProperty:(NSString *)key value:(id)value;
- (NSDictionary *)toJson;
- (instancetype)initWithApp:(BugsnagAppWithState *)app
device:(BugsnagDeviceWithState *)device
handledState:(BugsnagHandledState *)handledState
user:(BugsnagUser *)user
metadata:(BugsnagMetadata *)metadata
breadcrumbs:(NSArray<BugsnagBreadcrumb *> *)breadcrumbs
errors:(NSArray<BugsnagError *> *)errors
threads:(NSArray<BugsnagThread *> *)threads
session:(BugsnagSession *)session;
@end

@interface BugsnagError ()
- (instancetype)initWithErrorClass:(NSString *)errorClass
errorMessage:(NSString *)errorMessage
errorType:(BSGErrorType)errorType
stacktrace:(NSArray<BugsnagStackframe *> *)stacktrace;
@end

@interface BugsnagSessionTracker ()
@property(nonatomic) NSString *codeBundleId;
@end
Expand Down Expand Up @@ -394,8 +368,7 @@ - (instancetype)initWithConfiguration:(BugsnagConfiguration *)initConfiguration
self.extraRuntimeInfo = [NSMutableDictionary new];
self.metadataLock = [[NSLock alloc] init];
self.crashSentry = [BugsnagCrashSentry new];
self.errorReportApiClient = [[BugsnagErrorReportApiClient alloc] initWithConfig:configuration
queueName:@"Error API queue"];
self.errorReportApiClient = [[BugsnagErrorReportApiClient alloc] initWithSession:configuration.session queueName:@"Error API queue"];
bsg_g_bugsnag_data.onCrash = (void (*)(const BSG_KSCrashReportWriter *))self.configuration.onCrashHandler;

static dispatch_once_t once_t;
Expand Down Expand Up @@ -824,11 +797,9 @@ - (void)setupConnectivityListener {
[strongSelf flushPendingReports];
}

[self addAutoBreadcrumbOfType:BSGBreadcrumbTypeState
withMessage:@"Connectivity changed"
andMetadata:@{
@"type" : connectionType
}];
[strongSelf addAutoBreadcrumbOfType:BSGBreadcrumbTypeState
withMessage:@"Connectivity changed"
andMetadata:@{@"type": connectionType}];
}];
}

Expand Down
Loading

0 comments on commit d6509bf

Please sign in to comment.