Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Commit

Permalink
Merge pull request #445 from bugsnag/v2.23.6
Browse files Browse the repository at this point in the history
v2.23.6
  • Loading branch information
bengourley authored Feb 10, 2020
2 parents 87b7bbd + 42cdcaf commit 4e2028f
Show file tree
Hide file tree
Showing 25 changed files with 197 additions and 230 deletions.
34 changes: 30 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
Changelog
=========

## TBD
## 2.23.6 (2020-02-10)

### Bug fixes

* (iOS) Fix include for RCTVersion.h to work in custom Podfiles on all versions of React Native
[#443](https://github.com/bugsnag/bugsnag-react-native/pull/443)
* Add missing argument to `BeforeSend` type definition
[bugsnag-react-native#432](https://github.com/bugsnag/bugsnag-react-native/pull/432)
* (Android) Upgrade bugsnag-android to v4.22.3
* Allow disabling previous signal handler invocation for Unity ANRs
[#743](https://github.com/bugsnag/bugsnag-android/pull/743)
* Avoid polling when detecting ANRs by invoking JNI from SIGQUIT handler
[#741](https://github.com/bugsnag/bugsnag-android/pull/741)
* (iOS) Upgrade bugsnag-cocoa to v5.23.0
- This release removes support for reporting 'partial' or 'minimal' crash reports
where the crash report could not be entirely written (due to disk space or other
issues like the device battery dying). While sometimes the reports could point
in the right direction for debugging, they could also be confusing or not enough
information to pursue and close the issue successfully.

- This release also renames a few configuration properties to align better with the
intended use and other Bugsnag libraries, so people who use more than one
platform can easily find related functionality in a different library. The old
names are deprecated but still supported until the next major release.
[#435](https://github.com/bugsnag/bugsnag-cocoa/pull/435)

* `Bugsnag.setBreadcrumbCapacity()` is now `setMaxBreadcrumbs()` on the
`BugsnagConfiguration` class. In addition, the default number of breadcrumbs
saved has been raised to 25 and limited to no more than 100.
* `BugsnagConfiguration.autoNotify` is now named
`BugsnagConfiguration.autoDetectErrors`
* `BugsnagConfiguration.autoCaptureSessions` is now named
`BugsnagConfiguration.autoDetectSessions`


## 2.23.5 (2020-01-13)

Expand All @@ -15,8 +43,6 @@ Changelog
* (iOS) Fix a packaging issue introduced in 2.23.3 which prevented apps using
React Native 0.59 and below from building successfully
[#441](https://github.com/bugsnag/bugsnag-react-native/pull/441)


## 2.23.4 (2020-01-06)

### Bug fixes
Expand All @@ -27,7 +53,7 @@ Changelog
* Catch throwables when invoking methods on system services
[#623](https://github.com/bugsnag/bugsnag-android/pull/623)
* Fix possible crash when recording reports and breadcrumbs containing values
using different text encodings or UTF-8 control characters, followed by a
using different text encodings or UTF-8 control characters, followed by a
C/C++ crash.
[#584](https://github.com/bugsnag/bugsnag-android/pull/584)
* Fix crash when calling `NativeInterface.clearTab()` (from an integration
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ android {
}

dependencies {
api 'com.bugsnag:bugsnag-android:4.22.2'
api 'com.bugsnag:bugsnag-android:4.22.3'
implementation 'com.facebook.react:react-native:+'

androidTestImplementation 'junit:junit:4.12'
Expand Down
26 changes: 14 additions & 12 deletions cocoa/vendor/bugsnag-cocoa/Source/Bugsnag.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#import "BugsnagConfiguration.h"
#import "BugsnagMetaData.h"
#import "BugsnagPlugin.h"

static NSString *_Nonnull const BugsnagSeverityError = @"error";
static NSString *_Nonnull const BugsnagSeverityWarning = @"warning";
Expand Down Expand Up @@ -193,15 +194,6 @@ static NSString *_Nonnull const BugsnagSeverityInfo = @"info";
*/
+ (void)leaveBreadcrumbForNotificationName:(NSString *_Nonnull)notificationName;

/**
* Set the maximum number of breadcrumbs to keep and sent to Bugsnag.
* By default, we'll keep and send the 20 most recent breadcrumb log
* messages.
*
* @param capacity max number of breadcrumb log messages to send
*/
+ (void)setBreadcrumbCapacity:(NSUInteger)capacity;

/**
* Clear any breadcrumbs that have been left so far.
*/
Expand All @@ -221,7 +213,7 @@ static NSString *_Nonnull const BugsnagSeverityInfo = @"info";
* By default, sessions are automatically started when the application enters the foreground.
* If you wish to manually call startSession at
* the appropriate time in your application instead, the default behaviour can be disabled via
* shouldAutoCaptureSessions.
* autoTrackSessions.
*
* Any errors which occur in an active session count towards your application's
* stability score. You can prevent errors from counting towards your stability
Expand All @@ -239,7 +231,7 @@ static NSString *_Nonnull const BugsnagSeverityInfo = @"info";
* When a session is stopped, errors will not count towards your application's
* stability score. This can be advantageous if you do not wish these calculations to
* include a certain type of error, for example, a crash in a background service.
* You should disable automatic session tracking via shouldAutoCaptureSessions if you call this method.
* You should disable automatic session tracking via autoTrackSessions if you call this method.
*
* A stopped session can be resumed by calling resumeSession,
* which will make any subsequent errors count towards your application's
Expand All @@ -255,7 +247,7 @@ static NSString *_Nonnull const BugsnagSeverityInfo = @"info";
*
* If a session has already been resumed or started and has not been stopped, calling this
* method will have no effect. You should disable automatic session tracking via
* shouldAutoCaptureSessions if you call this method.
* autoTrackSessions if you call this method.
*
* It's important to note that sessions are stored in memory for the lifetime of the
* application process and are not persisted on disk. Therefore calling this method on app
Expand All @@ -272,4 +264,14 @@ static NSString *_Nonnull const BugsnagSeverityInfo = @"info";
*/
+ (BOOL)resumeSession;

/**
* Set the maximum number of breadcrumbs to keep and sent to Bugsnag.
* By default, we'll keep and send the 20 most recent breadcrumb log
* messages.
*
* @param capacity max number of breadcrumb log messages to send
*/
+ (void)setBreadcrumbCapacity:(NSUInteger)capacity
__deprecated_msg("Use [BugsnagConfiguration setMaxBreadcrumbs:] instead");

@end
21 changes: 20 additions & 1 deletion cocoa/vendor/bugsnag-cocoa/Source/Bugsnag.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@
#import "BugsnagLogger.h"
#import "BugsnagNotifier.h"
#import "BugsnagKeys.h"
#import "BugsnagPlugin.h"

static BugsnagNotifier *bsg_g_bugsnag_notifier = NULL;
static NSMutableArray <id<BugsnagPlugin>> *registeredPlugins;

@interface Bugsnag ()
+ (BugsnagNotifier *)notifier;
+ (BOOL)bugsnagStarted;
+ (void)registerPlugin:(id<BugsnagPlugin>)plugin;
@end

@interface NSDictionary (BSGKSMerge)
Expand All @@ -54,6 +57,7 @@ + (void)startBugsnagWithConfiguration:(BugsnagConfiguration *)configuration {
if ([configuration hasValidApiKey]) {
bsg_g_bugsnag_notifier =
[[BugsnagNotifier alloc] initWithConfiguration:configuration];
[self startPlugins];
[bsg_g_bugsnag_notifier start];
} else {
bsg_log_err(@"Bugsnag not initialized - a valid API key must be supplied.");
Expand All @@ -76,6 +80,21 @@ + (BugsnagNotifier *)notifier {
return bsg_g_bugsnag_notifier;
}

+ (void)registerPlugin:(id<BugsnagPlugin>)plugin {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
registeredPlugins = [NSMutableArray new];
});
[registeredPlugins addObject:plugin];
}

+ (void)startPlugins {
for (id<BugsnagPlugin> plugin in registeredPlugins) {
if (![plugin isStarted])
[plugin start];
}
}

+ (BOOL)appDidCrashLastLaunch {
if ([self bugsnagStarted]) {
return [self.notifier appCrashedLastLaunch];
Expand Down Expand Up @@ -217,7 +236,7 @@ + (void)leaveBreadcrumbForNotificationName:

+ (void)setBreadcrumbCapacity:(NSUInteger)capacity {
if ([self bugsnagStarted]) {
self.notifier.configuration.breadcrumbs.capacity = capacity;
[self.notifier.configuration setMaxBreadcrumbs:capacity];
}
}

Expand Down
4 changes: 2 additions & 2 deletions cocoa/vendor/bugsnag-cocoa/Source/BugsnagBreadcrumb.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ + (instancetype)breadcrumbWithBlock:(BSGBreadcrumbConfiguration)block {

@implementation BugsnagBreadcrumbs

NSUInteger BreadcrumbsDefaultCapacity = 20;
NSUInteger BreadcrumbsDefaultCapacity = 25;

- (instancetype)init {
static NSString *const BSGBreadcrumbCacheFileName = @"bugsnag_breadcrumbs.json";
Expand Down Expand Up @@ -263,7 +263,7 @@ - (void)setCapacity:(NSUInteger)capacity {
}
[self resizeToFitCapacity:capacity];
[self willChangeValueForKey:NSStringFromSelector(@selector(capacity))];
_capacity = capacity;
_capacity = MIN(100, capacity);
[self didChangeValueForKey:NSStringFromSelector(@selector(capacity))];
}
}
Expand Down
26 changes: 23 additions & 3 deletions cocoa/vendor/bugsnag-cocoa/Source/BugsnagConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,16 @@ NSArray<BeforeSendSession> *beforeSendSessionBlocks;
(const BSG_KSCrashReportWriter *_Nonnull writer);

/**
* YES if uncaught exceptions should be reported automatically
* YES if uncaught exceptions and other crashes should be reported automatically
*/
@property BOOL autoNotify;
@property BOOL autoDetectErrors;

/**
* Determines whether app sessions should be tracked automatically. By default this value is true.
* If this value is updated after +[Bugsnag start] is called, only subsequent automatic sessions
* will be captured.
*/
@property BOOL shouldAutoCaptureSessions;
@property BOOL autoTrackSessions;

/**
* Whether the app should report out of memory events which terminate the app
Expand Down Expand Up @@ -245,8 +245,28 @@ __deprecated_msg("This detection option is unreliable and should no longer be us
*/
- (BOOL)shouldSendReports;

/**
* The maximum number of breadcrumbs to keep and sent to Bugsnag.
* By default, we'll keep and send the 25 most recent breadcrumb log
* messages.
*/
@property NSUInteger maxBreadcrumbs;

- (void)addBeforeNotifyHook:(BugsnagBeforeNotifyHook _Nonnull)hook
__deprecated_msg("Use addBeforeSendBlock: instead.");

/**
* Determines whether app sessions should be tracked automatically. By default this value is true.
* If this value is updated after +[Bugsnag start] is called, only subsequent automatic sessions
* will be captured.
*/
@property BOOL shouldAutoCaptureSessions __deprecated_msg("Use autoTrackSessions instead");

/**
* YES if uncaught exceptions should be reported automatically
*/
@property BOOL autoNotify __deprecated_msg("Use autoDetectErrors instead");

/**
* Hooks for processing raw report data before it is sent to Bugsnag
*/
Expand Down
44 changes: 34 additions & 10 deletions cocoa/vendor/bugsnag-cocoa/Source/BugsnagConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ - (id)init {
_config = [[BugsnagMetaData alloc] init];
_apiKey = @"";
_sessionURL = [NSURL URLWithString:@"https://sessions.bugsnag.com"];
_autoNotify = YES;
_autoDetectErrors = YES;
_notifyURL = [NSURL URLWithString:BSGDefaultNotifyUrl];
_beforeNotifyHooks = [NSMutableArray new];
_beforeSendBlocks = [NSMutableArray new];
_beforeSendSessionBlocks = [NSMutableArray new];
_notifyReleaseStages = nil;
_breadcrumbs = [BugsnagBreadcrumbs new];
_automaticallyCollectBreadcrumbs = YES;
_shouldAutoCaptureSessions = YES;
_autoTrackSessions = YES;
#if !DEBUG
_reportOOMs = YES;
#endif
Expand Down Expand Up @@ -142,20 +142,28 @@ - (void)setReleaseStage:(NSString *)newReleaseStage {
}
}

@synthesize autoNotify = _autoNotify;
@synthesize autoDetectErrors = _autoDetectErrors;

- (BOOL)autoNotify {
return _autoNotify;
- (BOOL)autoDetectErrors {
return _autoDetectErrors;
}

- (void)setAutoNotify:(BOOL)shouldAutoNotify {
if (shouldAutoNotify == _autoNotify) {
- (void)setAutoDetectErrors:(BOOL)autoDetectErrors {
if (autoDetectErrors == _autoDetectErrors) {
return;
}
[self willChangeValueForKey:NSStringFromSelector(@selector(autoNotify))];
_autoNotify = shouldAutoNotify;
[self willChangeValueForKey:NSStringFromSelector(@selector(autoDetectErrors))];
_autoDetectErrors = autoDetectErrors;
[[Bugsnag notifier] updateCrashDetectionSettings];
[self didChangeValueForKey:NSStringFromSelector(@selector(autoNotify))];
[self didChangeValueForKey:NSStringFromSelector(@selector(autoDetectErrors))];
}

- (BOOL)autoNotify {
return self.autoDetectErrors;
}

- (void)setAutoNotify:(BOOL)autoNotify {
self.autoDetectErrors = autoNotify;
}

@synthesize notifyReleaseStages = _notifyReleaseStages;
Expand All @@ -177,6 +185,14 @@ - (void)setNotifyReleaseStages:(NSArray *)newNotifyReleaseStages;
}
}

- (void)setShouldAutoCaptureSessions:(BOOL)shouldAutoCaptureSessions {
self.autoTrackSessions = shouldAutoCaptureSessions;
}

- (BOOL)shouldAutoCaptureSessions {
return self.autoTrackSessions;
}

@synthesize automaticallyCollectBreadcrumbs = _automaticallyCollectBreadcrumbs;

- (BOOL)automaticallyCollectBreadcrumbs {
Expand Down Expand Up @@ -282,4 +298,12 @@ - (BOOL)hasValidApiKey {
return [_apiKey length] > 0;
}

- (NSUInteger)maxBreadcrumbs {
return self.breadcrumbs.capacity;
}

- (void)setMaxBreadcrumbs:(NSUInteger)capacity {
self.breadcrumbs.capacity = capacity;
}

@end
3 changes: 2 additions & 1 deletion cocoa/vendor/bugsnag-cocoa/Source/BugsnagCrashReport.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ NSString *_Nonnull BSGFormatSeverity(BSGSeverity severity);
* @return a Bugsnag crash report
*/
- (instancetype _Nonnull)initWithKSReport:(NSDictionary *_Nonnull)report
fileMetadata:(NSString *_Nonnull)metadata;
fileMetadata:(NSString *_Nonnull)metadata
__deprecated_msg("Use initWithKSReport: instead.");

/**
* Create a new crash report from a JSON crash report generated by
Expand Down
Loading

0 comments on commit 4e2028f

Please sign in to comment.