Skip to content

Commit

Permalink
Merge pull request #1117 from bugsnag/remove-category
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdowell committed Jun 10, 2021
2 parents ca5cdd3 + f4bf34c commit ee90d64
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 163 deletions.
18 changes: 0 additions & 18 deletions Bugsnag.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,6 @@
010FF28825ED2A8D00E4F2B0 /* BSGAppHangDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = 010FF28325ED2A8D00E4F2B0 /* BSGAppHangDetector.m */; };
010FF28925ED2A8D00E4F2B0 /* BSGAppHangDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = 010FF28325ED2A8D00E4F2B0 /* BSGAppHangDetector.m */; };
010FF28A25ED2A8D00E4F2B0 /* BSGAppHangDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = 010FF28325ED2A8D00E4F2B0 /* BSGAppHangDetector.m */; };
011ADCE326049A3600B20D72 /* BugsnagClient+OutOfMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 011ADCE126049A3600B20D72 /* BugsnagClient+OutOfMemory.h */; };
011ADCE426049A3600B20D72 /* BugsnagClient+OutOfMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 011ADCE126049A3600B20D72 /* BugsnagClient+OutOfMemory.h */; };
011ADCE526049A3600B20D72 /* BugsnagClient+OutOfMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 011ADCE126049A3600B20D72 /* BugsnagClient+OutOfMemory.h */; };
012482A325627B51003F7243 /* UIKitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 012482A225627B51003F7243 /* UIKitTests.m */; };
0126DF1B257A92860031A70C /* BugsnagSession+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 0126DF1A257A92860031A70C /* BugsnagSession+Private.h */; };
0126DF1C257A92860031A70C /* BugsnagSession+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 0126DF1A257A92860031A70C /* BugsnagSession+Private.h */; };
Expand Down Expand Up @@ -636,9 +633,6 @@
0126F7BF25DD512B008483C2 /* BSGEventUploadKSCrashReportOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0126F7BA25DD512B008483C2 /* BSGEventUploadKSCrashReportOperation.m */; };
0126F7C025DD512B008483C2 /* BSGEventUploadKSCrashReportOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0126F7BA25DD512B008483C2 /* BSGEventUploadKSCrashReportOperation.m */; };
0126F7C125DD512B008483C2 /* BSGEventUploadKSCrashReportOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0126F7BA25DD512B008483C2 /* BSGEventUploadKSCrashReportOperation.m */; };
0127149225F6171000D3500A /* BugsnagClient+AppHangs.h in Headers */ = {isa = PBXBuildFile; fileRef = 0127149025F6171000D3500A /* BugsnagClient+AppHangs.h */; };
0127149325F6171000D3500A /* BugsnagClient+AppHangs.h in Headers */ = {isa = PBXBuildFile; fileRef = 0127149025F6171000D3500A /* BugsnagClient+AppHangs.h */; };
0127149425F6171000D3500A /* BugsnagClient+AppHangs.h in Headers */ = {isa = PBXBuildFile; fileRef = 0127149025F6171000D3500A /* BugsnagClient+AppHangs.h */; };
0140D29A25767C9A00FD0306 /* BugsnagApiClientTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CB9103632502320A00E9D1E2 /* BugsnagApiClientTest.m */; };
01447605256684500018AB94 /* BugsnagApiClientTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CB9103632502320A00E9D1E2 /* BugsnagApiClientTest.m */; };
01468F5225876DC1002B0519 /* BSGNotificationBreadcrumbs.h in Headers */ = {isa = PBXBuildFile; fileRef = 01468F5025876DC1002B0519 /* BSGNotificationBreadcrumbs.h */; };
Expand Down Expand Up @@ -1283,8 +1277,6 @@
00E636C324878FFC006CBF1A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
010FF28225ED2A8D00E4F2B0 /* BSGAppHangDetector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BSGAppHangDetector.h; sourceTree = "<group>"; };
010FF28325ED2A8D00E4F2B0 /* BSGAppHangDetector.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BSGAppHangDetector.m; sourceTree = "<group>"; };
011ADCE126049A3600B20D72 /* BugsnagClient+OutOfMemory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagClient+OutOfMemory.h"; sourceTree = "<group>"; };
01210B7C25CD661800D683BB /* BugsnagThread+Recording.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagThread+Recording.h"; sourceTree = "<group>"; };
012482A225627B51003F7243 /* UIKitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIKitTests.m; sourceTree = "<group>"; };
0126DED7257A87F40031A70C /* BugsnagAppWithState+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagAppWithState+Private.h"; sourceTree = "<group>"; };
0126DEDF257A89490031A70C /* BugsnagBreadcrumb+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagBreadcrumb+Private.h"; sourceTree = "<group>"; };
Expand All @@ -1300,7 +1292,6 @@
0126F7AA25DD5118008483C2 /* BSGEventUploadFileOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BSGEventUploadFileOperation.m; sourceTree = "<group>"; };
0126F7B925DD512B008483C2 /* BSGEventUploadKSCrashReportOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BSGEventUploadKSCrashReportOperation.h; sourceTree = "<group>"; };
0126F7BA25DD512B008483C2 /* BSGEventUploadKSCrashReportOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BSGEventUploadKSCrashReportOperation.m; sourceTree = "<group>"; };
0127149025F6171000D3500A /* BugsnagClient+AppHangs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagClient+AppHangs.h"; 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>"; };
0140D24725765F8F00FD0306 /* BSGUIKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BSGUIKit.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1780,8 +1771,6 @@
isa = PBXGroup;
children = (
008967BB2486DA1900DC48C2 /* BugsnagClient.m */,
0127149025F6171000D3500A /* BugsnagClient+AppHangs.h */,
011ADCE126049A3600B20D72 /* BugsnagClient+OutOfMemory.h */,
008967BC2486DA1900DC48C2 /* BugsnagClient+Private.h */,
);
path = Client;
Expand Down Expand Up @@ -1895,7 +1884,6 @@
008968582486DA9500DC48C2 /* BugsnagStateEvent.m */,
008968612486DA9500DC48C2 /* BugsnagThread.m */,
0134524B256BD00A0088C548 /* BugsnagThread+Private.h */,
01210B7C25CD661800D683BB /* BugsnagThread+Recording.h */,
0089685F2486DA9500DC48C2 /* BugsnagUser.m */,
0126DF34257A94740031A70C /* BugsnagUser+Private.h */,
);
Expand Down Expand Up @@ -2040,7 +2028,6 @@
0126F7BB25DD512B008483C2 /* BSGEventUploadKSCrashReportOperation.h in Headers */,
008968DE2486DAA700DC48C2 /* BugsnagPluginClient.h in Headers */,
008969EA2486DAD100DC48C2 /* BSG_KSCrashReport.h in Headers */,
011ADCE326049A3600B20D72 /* BugsnagClient+OutOfMemory.h in Headers */,
008969F02486DAD100DC48C2 /* BSG_KSCrashReportFields.h in Headers */,
00896A2F2486DAD100DC48C2 /* BSG_KSCrashIdentifier.h in Headers */,
008969FC2486DAD100DC48C2 /* BSG_KSCrashAdvanced.h in Headers */,
Expand All @@ -2057,7 +2044,6 @@
008968F42486DAB800DC48C2 /* BugsnagSessionFileStore.h in Headers */,
008968882486DA9600DC48C2 /* BugsnagHandledState.h in Headers */,
CBCF77A325010648004AF22A /* BSGJSONSerialization.h in Headers */,
0127149225F6171000D3500A /* BugsnagClient+AppHangs.h in Headers */,
00896A082486DAD100DC48C2 /* BSG_KSCrashSentry_Private.h in Headers */,
008969722486DAD000DC48C2 /* BSG_KSSignalInfo.h in Headers */,
008967C22486DA1900DC48C2 /* BugsnagClient+Private.h in Headers */,
Expand Down Expand Up @@ -2144,7 +2130,6 @@
0126F7BC25DD512B008483C2 /* BSGEventUploadKSCrashReportOperation.h in Headers */,
008968DF2486DAA700DC48C2 /* BugsnagPluginClient.h in Headers */,
008969EB2486DAD100DC48C2 /* BSG_KSCrashReport.h in Headers */,
011ADCE426049A3600B20D72 /* BugsnagClient+OutOfMemory.h in Headers */,
008969F12486DAD100DC48C2 /* BSG_KSCrashReportFields.h in Headers */,
00896A302486DAD100DC48C2 /* BSG_KSCrashIdentifier.h in Headers */,
008969FD2486DAD100DC48C2 /* BSG_KSCrashAdvanced.h in Headers */,
Expand All @@ -2161,7 +2146,6 @@
0126F79C25DD510E008483C2 /* BSGEventUploadObjectOperation.h in Headers */,
008968892486DA9600DC48C2 /* BugsnagHandledState.h in Headers */,
00896A092486DAD100DC48C2 /* BSG_KSCrashSentry_Private.h in Headers */,
0127149325F6171000D3500A /* BugsnagClient+AppHangs.h in Headers */,
CBCF77A425010648004AF22A /* BSGJSONSerialization.h in Headers */,
008969732486DAD000DC48C2 /* BSG_KSSignalInfo.h in Headers */,
008967C32486DA1900DC48C2 /* BugsnagClient+Private.h in Headers */,
Expand Down Expand Up @@ -2248,7 +2232,6 @@
0126F7BD25DD512B008483C2 /* BSGEventUploadKSCrashReportOperation.h in Headers */,
008968E02486DAA700DC48C2 /* BugsnagPluginClient.h in Headers */,
008969EC2486DAD100DC48C2 /* BSG_KSCrashReport.h in Headers */,
011ADCE526049A3600B20D72 /* BugsnagClient+OutOfMemory.h in Headers */,
008969F22486DAD100DC48C2 /* BSG_KSCrashReportFields.h in Headers */,
00896A312486DAD100DC48C2 /* BSG_KSCrashIdentifier.h in Headers */,
008969FE2486DAD100DC48C2 /* BSG_KSCrashAdvanced.h in Headers */,
Expand All @@ -2265,7 +2248,6 @@
0126F79D25DD510E008483C2 /* BSGEventUploadObjectOperation.h in Headers */,
0089688A2486DA9600DC48C2 /* BugsnagHandledState.h in Headers */,
00896A0A2486DAD100DC48C2 /* BSG_KSCrashSentry_Private.h in Headers */,
0127149425F6171000D3500A /* BugsnagClient+AppHangs.h in Headers */,
CBCF77A525010648004AF22A /* BSGJSONSerialization.h in Headers */,
008969742486DAD100DC48C2 /* BSG_KSSignalInfo.h in Headers */,
008967C42486DA1900DC48C2 /* BugsnagClient+Private.h in Headers */,
Expand Down
55 changes: 0 additions & 55 deletions Bugsnag/Bugsnag.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@

static BugsnagClient *bsg_g_bugsnag_client = NULL;

@interface NSDictionary (BSGKSMerge)
- (NSDictionary *)BSG_mergedInto:(NSDictionary *)dest;
@end

@implementation Bugsnag

+ (BugsnagClient *_Nonnull)start {
Expand Down Expand Up @@ -357,54 +353,3 @@ + (void)removeOnBreadcrumbBlock:(BugsnagOnBreadcrumbBlock _Nonnull)block {
}

@end

//
// NSDictionary+Merge.m
//
// Created by Karl Stenerud on 2012-10-01.
//
// Copyright (c) 2012 Karl Stenerud. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall remain in place
// in this source code.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//

@implementation NSDictionary (BSGKSMerge)

- (NSDictionary *)BSG_mergedInto:(NSDictionary *)dest {
if ([dest count] == 0) {
return self;
}
if ([self count] == 0) {
return dest;
}

NSMutableDictionary *dict = [dest mutableCopy];
for (id key in [self allKeys]) {
id srcEntry = self[key];
id dstEntry = dest[key];
if ([dstEntry isKindOfClass:[NSDictionary class]] &&
[srcEntry isKindOfClass:[NSDictionary class]]) {
srcEntry = [srcEntry BSG_mergedInto:dstEntry];
}
dict[key] = srcEntry;
}
return dict;
}

@end
24 changes: 0 additions & 24 deletions Bugsnag/Client/BugsnagClient+AppHangs.h

This file was deleted.

21 changes: 0 additions & 21 deletions Bugsnag/Client/BugsnagClient+OutOfMemory.h

This file was deleted.

7 changes: 7 additions & 0 deletions Bugsnag/Client/BugsnagClient+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ NS_ASSUME_NONNULL_BEGIN

- (BugsnagDeviceWithState *)generateDeviceWithState:(NSDictionary *)systemInfo;

- (BugsnagEvent *)generateOutOfMemoryEvent;

/// @return A `BugsnagEvent` if the last run ended with a fatal app hang, `nil` otherwise.
- (nullable BugsnagEvent *)loadFatalAppHangEvent;

- (void)notifyInternal:(BugsnagEvent *)event block:(nullable BugsnagOnErrorBlock)block;

- (void)removeObserverWithBlock:(BugsnagObserverBlock)block; // Used in BugsnagReactNative
Expand All @@ -142,6 +147,8 @@ NS_ASSUME_NONNULL_BEGIN

- (void)start;

- (void)startAppHangDetector;

@end

NS_ASSUME_NONNULL_END
14 changes: 4 additions & 10 deletions Bugsnag/Client/BugsnagClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#import "BugsnagClient+Private.h"

#import "BSGAppHangDetector.h"
#import "BSGConnectivity.h"
#import "BSGEventUploader.h"
#import "BSGFileLocations.h"
Expand All @@ -48,8 +49,6 @@
#import "BugsnagAppWithState+Private.h"
#import "BugsnagBreadcrumb+Private.h"
#import "BugsnagBreadcrumbs.h"
#import "BugsnagClient+AppHangs.h"
#import "BugsnagClient+OutOfMemory.h"
#import "BugsnagCollections.h"
#import "BugsnagConfiguration+Private.h"
#import "BugsnagCrashSentry.h"
Expand All @@ -71,7 +70,6 @@
#import "BugsnagStateEvent.h"
#import "BugsnagSystemState.h"
#import "BugsnagThread+Private.h"
#import "BugsnagThread+Recording.h"
#import "BugsnagUser+Private.h"

#if BSG_PLATFORM_IOS || BSG_PLATFORM_TVOS
Expand Down Expand Up @@ -112,10 +110,6 @@
static NSUInteger unhandledCount;
static bool hasRecordedSessions;

@interface NSDictionary (BSGKSMerge)
- (NSDictionary *)BSG_mergedInto:(NSDictionary *)dest;
@end

/**
* Handler executed when the application crashes. Writes information about the
* current application state using the crash report writer.
Expand Down Expand Up @@ -213,7 +207,7 @@ void BSGWriteSessionCrashData(BugsnagSession *session) {

// MARK: -

@interface BugsnagClient () <BSGBreadcrumbSink, BSGInternalErrorReporterDataSource>
@interface BugsnagClient () <BSGAppHangDetectorDelegate, BSGBreadcrumbSink, BSGInternalErrorReporterDataSource>

@property (nonatomic) BSGNotificationBreadcrumbs *notificationBreadcrumbs;

Expand Down Expand Up @@ -1215,7 +1209,7 @@ - (void)updateCrashDetectionSettings {
// OOMs are controlled by config.autoDetectErrors so don't require any further action
}

#pragma mark BugsnagClient+AppHangs
// MARK: - App Hangs

- (void)startAppHangDetector {
[NSFileManager.defaultManager removeItemAtPath:BSGFileLocations.current.appHangEvent error:nil];
Expand Down Expand Up @@ -1305,7 +1299,7 @@ - (nullable BugsnagEvent *)loadFatalAppHangEvent {
return event;
}

#pragma mark BugsnagClient+OutOfMemory
// MARK: - OOMs

- (BugsnagEvent *)generateOutOfMemoryEvent {
NSDictionary *appDict = self.systemState.lastLaunchState[SYSTEMSTATE_KEY_APP];
Expand Down
1 change: 0 additions & 1 deletion Bugsnag/Helpers/BSGAppHangDetector.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#import "BSG_KSMach.h"
#import "BugsnagCollections.h"
#import "BugsnagLogger.h"
#import "BugsnagThread+Recording.h"
#import "BugsnagThread+Private.h"

#if TARGET_OS_IOS
Expand Down
7 changes: 1 addition & 6 deletions Bugsnag/Payload/BugsnagEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,7 @@ id BSGLoadConfigValue(NSDictionary *report, NSString *valueName) {
return nil;
}

// MARK: - BugsnagEvent implementation

@interface NSDictionary (BSGKSMerge)
- (NSDictionary *)BSG_mergedInto:(NSDictionary *)dest;
@end

// MARK: -

@implementation BugsnagEvent

Expand Down
4 changes: 4 additions & 0 deletions Bugsnag/Payload/BugsnagThread+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ NS_ASSUME_NONNULL_BEGIN

- (instancetype)initWithThread:(NSDictionary *)thread binaryImages:(NSArray *)binaryImages;

+ (NSArray<BugsnagThread *> *)allThreads:(BOOL)allThreads callStackReturnAddresses:(NSArray<NSNumber *> *)callStackReturnAddresses;

+ (instancetype)threadFromJson:(NSDictionary *)json;

@property (readonly, nullable, nonatomic) NSString *crashInfoMessage;
Expand All @@ -30,6 +32,8 @@ NS_ASSUME_NONNULL_BEGIN
depth:(NSUInteger)depth
errorType:(nullable NSString *)errorType;

+ (nullable instancetype)mainThread;

+ (NSMutableArray *)serializeThreads:(nullable NSArray<BugsnagThread *> *)threads;

+ (NSMutableArray<BugsnagThread *> *)threadsFromArray:(NSArray *)threads
Expand Down
21 changes: 0 additions & 21 deletions Bugsnag/Payload/BugsnagThread+Recording.h

This file was deleted.

11 changes: 5 additions & 6 deletions Bugsnag/Payload/BugsnagThread.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@

#import "BugsnagThread+Private.h"

#import "BSG_KSBacktrace_Private.h"
#import "BSG_KSCrashReportFields.h"
#import "BSG_KSCrashSentry_Private.h"
#import "BSG_KSMach.h"
#import "BugsnagCollections.h"
#import "BugsnagKeys.h"
#import "BugsnagStackframe+Private.h"
#import "BugsnagStacktrace.h"
#import "BugsnagKeys.h"
#import "BugsnagThread+Recording.h"
#import "BugsnagThread+Private.h"
#include "BSG_KSBacktrace_Private.h"
#include "BSG_KSCrashSentry_Private.h"
#include "BSG_KSMach.h"

#include <pthread.h>

Expand Down Expand Up @@ -195,7 +194,7 @@ + (NSDictionary *)enhanceThreadInfo:(NSDictionary *)thread
return thread;
}

#pragma mark BugsnagThread+Recording
// MARK: - Recording

+ (NSArray<BugsnagThread *> *)allThreads:(BOOL)allThreads callStackReturnAddresses:(NSArray<NSNumber *> *)callStackReturnAddresses {
struct backtrace_t backtrace;
Expand Down
1 change: 0 additions & 1 deletion Tests/BugsnagThreadTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#import "BSG_KSMachHeaders.h"
#import "BugsnagStackframe+Private.h"
#import "BugsnagThread+Private.h"
#import "BugsnagThread+Recording.h"

#include <stdatomic.h>

Expand Down

0 comments on commit ee90d64

Please sign in to comment.