Skip to content

Commit

Permalink
Merge pull request #1315 from bugsnag/release-v6.16.4
Browse files Browse the repository at this point in the history
Release v6.16.4
  • Loading branch information
nickdowell authored Mar 3, 2022
2 parents 9292712 + 95be367 commit b4758ce
Show file tree
Hide file tree
Showing 54 changed files with 373 additions and 1,309 deletions.
4 changes: 2 additions & 2 deletions .buildkite/pipeline.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ steps:
- "--app=/app/build/iOSTestApp.ipa"
- "--farm=bs"
- "--device=IOS_14"
- "--appium-version=1.17.0"
- "--appium-version=1.21.0"
- "--fail-fast"
- "--exclude=features/[h-z].*.feature$"
- "--order=random"
Expand All @@ -50,7 +50,7 @@ steps:
- "--app=/app/build/iOSTestApp.ipa"
- "--farm=bs"
- "--device=IOS_14"
- "--appium-version=1.17.0"
- "--appium-version=1.21.0"
- "--fail-fast"
- "--exclude=features/[a-g].*.feature$"
- "--order=random"
Expand Down
4 changes: 2 additions & 2 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ author_url: "https://www.bugsnag.com"
author: "Bugsnag Inc"
clean: false # avoid deleting docs/.git
framework_root: "Bugsnag"
github_file_prefix: "https://github.com/bugsnag/bugsnag-cocoa/tree/v6.16.3/Bugsnag"
github_file_prefix: "https://github.com/bugsnag/bugsnag-cocoa/tree/v6.16.4/Bugsnag"
github_url: "https://github.com/bugsnag/bugsnag-cocoa"
hide_documentation_coverage: true
module: "Bugsnag"
module_version: "6.16.3"
module_version: "6.16.4"
objc: true
output: "docs"
readme: "README.md"
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.16.3",
"version": "6.16.4",
"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.16.3"
"tag": "v6.16.4"
},
"frameworks": [
"Foundation",
Expand Down
78 changes: 20 additions & 58 deletions Bugsnag.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions Bugsnag/BSGCrashSentry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// BSGCrashSentry.h
// Bugsnag
//
// Created by Jamie Lynch on 11/08/2017.
//
//

#import <Foundation/Foundation.h>

#import "BSG_KSCrashReportWriter.h"
#import "BSG_KSCrashType.h"

@class BugsnagConfiguration;
@class BugsnagErrorTypes;

NS_ASSUME_NONNULL_BEGIN

void BSGCrashSentryInstall(BugsnagConfiguration *, BSG_KSReportWriteCallback);

BSG_KSCrashType BSG_KSCrashTypeFromBugsnagErrorTypes(BugsnagErrorTypes *);

NS_ASSUME_NONNULL_END
37 changes: 15 additions & 22 deletions Bugsnag/BugsnagCrashSentry.m → Bugsnag/BSGCrashSentry.m
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
//
// BugsnagCrashSentry.m
// Pods
// BSGCrashSentry.m
// Bugsnag
//
// Created by Jamie Lynch on 11/08/2017.
//
//


#import "BugsnagCrashSentry.h"
#import "BSGCrashSentry.h"

#import "BSGFileLocations.h"
#import "BSG_KSCrashAdvanced.h"
#import "BSG_KSCrash.h"
#import "BSG_KSCrashC.h"
#import "BSG_KSMach.h"
#import "BugsnagConfiguration.h"
#import "BugsnagErrorTypes.h"
#import "BugsnagLogger.h"

@implementation BugsnagCrashSentry

- (void)install:(BugsnagConfiguration *)config onCrash:(BSGReportCallback)onCrash
{
void BSGCrashSentryInstall(BugsnagConfiguration *config, BSG_KSReportWriteCallback onCrash) {
BSG_KSCrash *ksCrash = [BSG_KSCrash sharedInstance];
ksCrash.introspectMemory = NO;
ksCrash.onCrash = onCrash;
ksCrash.maxStoredReports = (int)config.maxPersistedEvents;

bsg_kscrash_setCrashNotifyCallback(onCrash);

// overridden elsewhere for handled errors, so we can assume that this only
// applies to unhandled errors
ksCrash.threadTracingEnabled = config.sendThreads != BSGThreadSendPolicyNever;
bsg_kscrash_setThreadTracingEnabled(config.sendThreads != BSGThreadSendPolicyNever);

BSG_KSCrashType crashTypes = 0;
if (config.autoDetectErrors) {
if (bsg_ksmachisBeingTraced()) {
bsg_log_info(@"Unhandled errors will not be reported because a debugger is attached");
} else {
crashTypes = [self mapKSToBSGCrashTypes:config.enabledErrorTypes];
crashTypes = BSG_KSCrashTypeFromBugsnagErrorTypes(config.enabledErrorTypes);
}
}

Expand All @@ -53,12 +49,9 @@ - (void)install:(BugsnagConfiguration *)config onCrash:(BSGReportCallback)onCras
* @param errorTypes The enabled error types
* @returns A BSG_KSCrashType equivalent (with the above caveats) to the input
*/
- (BSG_KSCrashType)mapKSToBSGCrashTypes:(BugsnagErrorTypes *)errorTypes
{
return (BSG_KSCrashType) ((errorTypes.unhandledExceptions ? BSG_KSCrashTypeNSException : 0)
| (errorTypes.cppExceptions ? BSG_KSCrashTypeCPPException : 0)
| (errorTypes.signals ? BSG_KSCrashTypeSignal : 0)
| (errorTypes.machExceptions ? BSG_KSCrashTypeMachException : 0));
BSG_KSCrashType BSG_KSCrashTypeFromBugsnagErrorTypes(BugsnagErrorTypes *errorTypes) {
return ((errorTypes.unhandledExceptions ? BSG_KSCrashTypeNSException : 0) |
(errorTypes.cppExceptions ? BSG_KSCrashTypeCPPException : 0) |
(errorTypes.signals ? BSG_KSCrashTypeSignal : 0) |
(errorTypes.machExceptions ? BSG_KSCrashTypeMachException : 0) );
}

@end
23 changes: 0 additions & 23 deletions Bugsnag/BugsnagCrashSentry.h

This file was deleted.

1 change: 0 additions & 1 deletion Bugsnag/BugsnagSystemState.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#define SYSTEMSTATE_KEY_DEVICE @"device"

#define SYSTEMSTATE_APP_WAS_TERMINATED @"wasTerminated"
#define SYSTEMSTATE_APP_IS_ACTIVE @"isActive"
#define SYSTEMSTATE_APP_IS_IN_FOREGROUND @"inForeground"
#define SYSTEMSTATE_APP_IS_LAUNCHING BSGKeyIsLaunching
#define SYSTEMSTATE_APP_VERSION @"version"
Expand Down
29 changes: 11 additions & 18 deletions Bugsnag/BugsnagSystemState.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#import "BSGFileLocations.h"
#import "BSGJSONSerialization.h"
#import "BSGUtils.h"
#import "BSG_KSCrashState.h"
#import "BSG_KSMach.h"
#import "BSG_KSSystemInfo.h"
#import "BSG_RFC3339DateTool.h"
Expand Down Expand Up @@ -57,7 +58,6 @@

// KV-store versions of these are authoritative
for (NSString *key in @[SYSTEMSTATE_APP_DEBUGGER_IS_ACTIVE,
SYSTEMSTATE_APP_IS_ACTIVE,
SYSTEMSTATE_APP_IS_IN_FOREGROUND,
SYSTEMSTATE_APP_IS_LAUNCHING,
SYSTEMSTATE_APP_WAS_TERMINATED]) {
Expand Down Expand Up @@ -85,18 +85,19 @@ id blankIfNil(id value) {

bool isBeingDebugged = bsg_ksmachisBeingTraced();
bool isInForeground = true;
bool isActive = true;
#if TARGET_OS_OSX
// MacOS "active" serves the same purpose as "foreground" in iOS
isInForeground = [NSAPPLICATION sharedApplication].active;
#else
UIApplicationState appState = [BSG_KSSystemInfo currentAppState];
isInForeground = [BSG_KSSystemInfo isInForeground:appState];
isActive = appState == UIApplicationStateActive;
const BSG_KSCrash_State *crashState = bsg_kscrashstate_currentState();
NSCParameterAssert(crashState != nil);
if (crashState) {
isInForeground = crashState->applicationIsInForeground;
}
#endif

[kvstore deleteKey:SYSTEMSTATE_APP_WAS_TERMINATED];
[kvstore setBoolean:isActive forKey:SYSTEMSTATE_APP_IS_ACTIVE];
[kvstore deleteKey:@"isActive"]; // Deprecated key
[kvstore setBoolean:isInForeground forKey:SYSTEMSTATE_APP_IS_IN_FOREGROUND];
[kvstore setBoolean:true forKey:SYSTEMSTATE_APP_IS_LAUNCHING];
[kvstore setBoolean:isBeingDebugged forKey:SYSTEMSTATE_APP_DEBUGGER_IS_ACTIVE];
Expand All @@ -110,7 +111,6 @@ id blankIfNil(id value) {
app[BSGKeyMachoUUID] = systemInfo[@BSG_KSSystemField_AppUUID];
app[@"binaryArch"] = systemInfo[@BSG_KSSystemField_BinaryArch];
app[@"inForeground"] = @(isInForeground);
app[@"isActive"] = @(isActive);
#if TARGET_OS_TV
app[BSGKeyType] = @"tvOS";
#elif TARGET_OS_IOS
Expand Down Expand Up @@ -225,14 +225,8 @@ - (instancetype)initWithConfiguration:(BugsnagConfiguration *)config {
[center addObserverForName:UIApplicationDidBecomeActiveNotification object:nil queue:nil
usingBlock:^(__attribute__((unused)) NSNotification * _Nonnull note) {
__strong __typeof__(self) strongSelf = weakSelf;
[strongSelf.kvStore setBoolean:YES forKey:SYSTEMSTATE_APP_IS_ACTIVE];
[strongSelf setValue:@YES forAppKey:SYSTEMSTATE_APP_IS_ACTIVE];
}];
[center addObserverForName:UIApplicationWillResignActiveNotification object:nil queue:nil
usingBlock:^(__attribute__((unused)) NSNotification * _Nonnull note) {
__strong __typeof__(self) strongSelf = weakSelf;
[strongSelf.kvStore setBoolean:NO forKey:SYSTEMSTATE_APP_IS_ACTIVE];
[strongSelf setValue:@NO forAppKey:SYSTEMSTATE_APP_IS_ACTIVE];
[strongSelf.kvStore setBoolean:YES forKey:SYSTEMSTATE_APP_IS_IN_FOREGROUND];
[strongSelf setValue:@YES forAppKey:SYSTEMSTATE_APP_IS_IN_FOREGROUND];
}];
#endif
[center addObserver:self selector:@selector(sessionUpdateNotification:) name:BSGSessionUpdateNotification object:nil];
Expand Down Expand Up @@ -353,9 +347,8 @@ - (BOOL)lastLaunchTerminatedUnexpectedly {
return NO; // The debugger may have killed the app
}

// If the app was inactive or in the background, we cannot determine whether the termination was unexpected
if (![previousAppState[SYSTEMSTATE_APP_IS_ACTIVE] boolValue] ||
![previousAppState[SYSTEMSTATE_APP_IS_IN_FOREGROUND] boolValue]) {
// If the app was in the background, we cannot determine whether the termination was unexpected
if (![previousAppState[SYSTEMSTATE_APP_IS_IN_FOREGROUND] boolValue]) {
return NO;
}

Expand Down
10 changes: 0 additions & 10 deletions Bugsnag/Client/BugsnagClient+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
@class BugsnagAppWithState;
@class BugsnagBreadcrumbs;
@class BugsnagConfiguration;
@class BugsnagCrashSentry;
@class BugsnagDeviceWithState;
@class BugsnagMetadata;
@class BugsnagNotifier;
@class BugsnagPluginClient;
@class BugsnagSessionTracker;
@class BugsnagSystemState;

Expand All @@ -45,10 +43,6 @@ typedef void (^ BSGClientObserver)(BSGClientObserverEvent event, _Nullable id va

@property (nullable, nonatomic) BugsnagEvent *appHangEvent;

/// Alters whether error detection should be enabled or not after Bugsnag has been initialized.
/// Intended for internal use only by Unity.
@property (nonatomic) BOOL autoNotify;

@property (nullable, retain, nonatomic) BugsnagBreadcrumbs *breadcrumbs;

@property (nullable, nonatomic) NSString *codeBundleId;
Expand All @@ -59,8 +53,6 @@ typedef void (^ BSGClientObserver)(BSGClientObserverEvent event, _Nullable id va

@property (retain, nonatomic) BugsnagConfiguration *configuration;

@property (strong, nonatomic) BugsnagCrashSentry *crashSentry;

/// The App hang or OOM event that caused the last launch to crash.
@property (nullable, nonatomic) BugsnagEvent *eventFromLastLaunch;

Expand All @@ -80,8 +72,6 @@ typedef void (^ BSGClientObserver)(BSGClientObserverEvent event, _Nullable id va

@property (readonly, nonatomic) BugsnagNotifier *notifier; // Used in BugsnagReactNative

@property (strong, nonatomic) BugsnagPluginClient *pluginClient;

@property (strong, nonatomic) BugsnagSessionTracker *sessionTracker; // Used in BugsnagReactNative

@property (nonatomic) BOOL started;
Expand Down
Loading

0 comments on commit b4758ce

Please sign in to comment.