Skip to content

Commit

Permalink
Fix setting custom notifier info
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdowell committed Jan 17, 2022
1 parent 6004ffa commit 2af1e27
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions Bugsnag/Configuration/BugsnagConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ - (nonnull id)copyWithZone:(nullable __attribute__((unused)) NSZone *)zone {
[copy setMaxPersistedEvents:self.maxPersistedEvents];
[copy setMaxPersistedSessions:self.maxPersistedSessions];
[copy setMaxBreadcrumbs:self.maxBreadcrumbs];
[copy setNotifier:self.notifier];
[copy setFeatureFlagStore:self.featureFlagStore];
[copy setMetadata:self.metadata];
[copy setEndpoints:self.endpoints];
Expand Down
9 changes: 9 additions & 0 deletions Tests/BugsnagTests/BugsnagConfigurationTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "BugsnagCrashSentry.h"
#import "BugsnagEndpointConfiguration.h"
#import "BugsnagErrorTypes.h"
#import "BugsnagNotifier.h"
#import "BugsnagSessionTracker.h"
#import "BugsnagTestConstants.h"

Expand Down Expand Up @@ -855,6 +856,10 @@ - (void)testNSCopying {
[config setAutoDetectErrors:YES];
[config setContext:@"context1"];
[config setAppType:@"The most amazing app, a brilliant app, the app to end all apps"];
[config setNotifier:[[BugsnagNotifier alloc] initWithName:@"Example"
version:@"0.0.0"
url:@"https://example.com"
dependencies:@[[[BugsnagNotifier alloc] init]]]];
[config setPersistUser:YES];
[config setSendThreads:BSGThreadSendPolicyUnhandledOnly];
BugsnagOnSendErrorBlock onSendBlock1 = ^BOOL(BugsnagEvent * _Nonnull event) { return true; };
Expand Down Expand Up @@ -901,6 +906,10 @@ - (void)testNSCopying {
XCTAssertEqual(config.onSendBlocks[0], clone.onSendBlocks[0]);
[clone setOnSendBlocks:[@[ onSendBlock2 ] mutableCopy]];
XCTAssertNotEqual(config.onSendBlocks[0], clone.onSendBlocks[0]);

XCTAssertEqualObjects(clone.notifier.name, config.notifier.name);
XCTAssertEqualObjects(clone.notifier.version, config.notifier.version);
XCTAssertEqualObjects(clone.notifier.url, config.notifier.url);
}

- (void)testMetadataMutability {
Expand Down

0 comments on commit 2af1e27

Please sign in to comment.