diff --git a/CHANGELOG.md b/CHANGELOG.md index fa573350348..0c78bb1440d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ ### Improvements - Replace deprecated SCNetworkReachability with NWPathMonitor (#6019) +- Increase attachment max size to 100MB (#6537) ## 8.57.0 diff --git a/Sources/Sentry/Public/SentryOptions.h b/Sources/Sentry/Public/SentryOptions.h index 7140cefa0e7..ac27445d54a 100644 --- a/Sources/Sentry/Public/SentryOptions.h +++ b/Sources/Sentry/Public/SentryOptions.h @@ -267,7 +267,7 @@ NS_SWIFT_NAME(Options) /** * The maximum size for each attachment in bytes. - * @note Default is 20 MiB (20 ✕ 1024 ✕ 1024 bytes). + * @note Default is 100 MiB (100 ✕ 1024 ✕ 1024 bytes). * @note Please also check the maximum attachment size of relay to make sure your attachments don't * get discarded there: * https://docs.sentry.io/product/relay/options/ diff --git a/Sources/Sentry/SentryOptions.m b/Sources/Sentry/SentryOptions.m index f3c455130ae..4cbd6efaa17 100644 --- a/Sources/Sentry/SentryOptions.m +++ b/Sources/Sentry/SentryOptions.m @@ -82,7 +82,9 @@ - (instancetype)init self.enableWatchdogTerminationTracking = YES; self.sessionTrackingIntervalMillis = [@30000 unsignedIntValue]; self.attachStacktrace = YES; - self.maxAttachmentSize = 20 * 1024 * 1024; + // Maximum attachment size is 100 MiB, matches Relay's limit: + // https://develop.sentry.dev/sdk/data-model/envelopes/#size-limits + self.maxAttachmentSize = 100 * 1024 * 1024; self.sendDefaultPii = NO; self.enableAutoPerformanceTracing = YES; self.enablePersistingTracesWhenCrashing = NO; diff --git a/Tests/SentryTests/SentryOptionsTest.m b/Tests/SentryTests/SentryOptionsTest.m index e31a6f40e14..47112d741ac 100644 --- a/Tests/SentryTests/SentryOptionsTest.m +++ b/Tests/SentryTests/SentryOptionsTest.m @@ -724,7 +724,7 @@ - (void)assertDefaultValues:(SentryOptions *)options XCTAssertEqual(YES, options.enableWatchdogTerminationTracking); XCTAssertEqual([@30000 unsignedIntValue], options.sessionTrackingIntervalMillis); XCTAssertEqual(YES, options.attachStacktrace); - XCTAssertEqual(20 * 1024 * 1024, options.maxAttachmentSize); + XCTAssertEqual(100 * 1024 * 1024, options.maxAttachmentSize); XCTAssertEqual(NO, options.sendDefaultPii); XCTAssertTrue(options.enableAutoPerformanceTracing); #if SENTRY_HAS_UIKIT @@ -854,7 +854,7 @@ - (void)testDefaultMaxAttachmentSize { SentryOptions *options = [self getValidOptions:@{}]; - XCTAssertEqual(20 * 1024 * 1024, options.maxAttachmentSize); + XCTAssertEqual(100 * 1024 * 1024, options.maxAttachmentSize); } - (void)testSendDefaultPii diff --git a/scripts/.swiftlint-version b/scripts/.swiftlint-version index 0b09455034e..92c648bd8c3 100644 --- a/scripts/.swiftlint-version +++ b/scripts/.swiftlint-version @@ -1 +1 @@ -0.61.0 +0.62.2