-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1050 from bugsnag/release-v6.8.1
Release v6.8.1
- Loading branch information
Showing
30 changed files
with
190 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// BugsnagClient+OutOfMemory.h | ||
// Bugsnag | ||
// | ||
// Created by Nick Dowell on 19/03/2021. | ||
// Copyright © 2021 Bugsnag Inc. All rights reserved. | ||
// | ||
|
||
#import <Bugsnag/Bugsnag.h> | ||
|
||
@class BugsnagEvent; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface BugsnagClient (OutOfMemory) | ||
|
||
- (BugsnagEvent *)generateOutOfMemoryEvent; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// BugsnagClient+OutOfMemory.m | ||
// Bugsnag | ||
// | ||
// Created by Nick Dowell on 19/03/2021. | ||
// Copyright © 2021 Bugsnag Inc. All rights reserved. | ||
// | ||
|
||
#import "BugsnagClient+OutOfMemory.h" | ||
|
||
#import "BugsnagAppWithState+Private.h" | ||
#import "BugsnagBreadcrumbs.h" | ||
#import "BugsnagClient+Private.h" | ||
#import "BugsnagDeviceWithState+Private.h" | ||
#import "BugsnagError+Private.h" | ||
#import "BugsnagEvent+Private.h" | ||
#import "BugsnagHandledState.h" | ||
#import "BugsnagKeys.h" | ||
#import "BugsnagSession+Private.h" | ||
#import "BugsnagSystemState.h" | ||
|
||
@implementation BugsnagClient (OutOfMemory) | ||
|
||
- (BugsnagEvent *)generateOutOfMemoryEvent { | ||
NSDictionary *appDict = self.systemState.lastLaunchState[SYSTEMSTATE_KEY_APP]; | ||
BugsnagAppWithState *app = [BugsnagAppWithState appFromJson:appDict]; | ||
app.dsymUuid = appDict[BSGKeyMachoUUID]; | ||
app.isLaunching = [self.stateMetadataFromLastLaunch[BSGKeyApp][BSGKeyIsLaunching] boolValue]; | ||
|
||
NSDictionary *deviceDict = self.systemState.lastLaunchState[SYSTEMSTATE_KEY_DEVICE]; | ||
BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceFromJson:deviceDict]; | ||
device.manufacturer = @"Apple"; | ||
device.orientation = self.stateMetadataFromLastLaunch[BSGKeyDeviceState][BSGKeyOrientation]; | ||
|
||
BugsnagMetadata *metadata = [[BugsnagMetadata alloc] initWithDictionary:self.metadataFromLastLaunch ?: @{}]; | ||
[metadata addMetadata:self.stateMetadataFromLastLaunch[BSGKeyDeviceState] toSection:BSGKeyDevice]; | ||
|
||
NSDictionary *sessionDict = self.systemState.lastLaunchState[BSGKeySession]; | ||
BugsnagSession *session = sessionDict ? [[BugsnagSession alloc] initWithDictionary:sessionDict] : nil; | ||
session.unhandledCount += 1; | ||
|
||
BugsnagError *error = | ||
[[BugsnagError alloc] initWithErrorClass:@"Out Of Memory" | ||
errorMessage:@"The app was likely terminated by the operating system while in the foreground" | ||
errorType:BSGErrorTypeCocoa | ||
stacktrace:nil]; | ||
|
||
BugsnagEvent *event = | ||
[[BugsnagEvent alloc] initWithApp:app | ||
device:device | ||
handledState:[BugsnagHandledState handledStateWithSeverityReason:LikelyOutOfMemory] | ||
user:session.user | ||
metadata:metadata | ||
breadcrumbs:self.breadcrumbs.breadcrumbs | ||
errors:@[error] | ||
threads:nil | ||
session:session]; | ||
|
||
return event; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.