Skip to content

Commit e81ca14

Browse files
authored
chore: Increase maximum attachment size to 100MB in SentryOptions (#6537)
* chore: Increase maximum attachment size to 100MB in SentryOptions * Update CHANGELOG.md * Bump attachment max size in tests * Update SentryOptions.h comment
1 parent e648312 commit e81ca14

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
### Improvements
4949

5050
- Replace deprecated SCNetworkReachability with NWPathMonitor (#6019)
51+
- Increase attachment max size to 100MB (#6537)
5152

5253
## 8.57.0
5354

Sources/Sentry/Public/SentryOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ NS_SWIFT_NAME(Options)
267267

268268
/**
269269
* The maximum size for each attachment in bytes.
270-
* @note Default is 20 MiB (20 ✕ 1024 ✕ 1024 bytes).
270+
* @note Default is 100 MiB (100 ✕ 1024 ✕ 1024 bytes).
271271
* @note Please also check the maximum attachment size of relay to make sure your attachments don't
272272
* get discarded there:
273273
* https://docs.sentry.io/product/relay/options/

Sources/Sentry/SentryOptions.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ - (instancetype)init
8282
self.enableWatchdogTerminationTracking = YES;
8383
self.sessionTrackingIntervalMillis = [@30000 unsignedIntValue];
8484
self.attachStacktrace = YES;
85-
self.maxAttachmentSize = 20 * 1024 * 1024;
85+
// Maximum attachment size is 100 MiB, matches Relay's limit:
86+
// https://develop.sentry.dev/sdk/data-model/envelopes/#size-limits
87+
self.maxAttachmentSize = 100 * 1024 * 1024;
8688
self.sendDefaultPii = NO;
8789
self.enableAutoPerformanceTracing = YES;
8890
self.enablePersistingTracesWhenCrashing = NO;

Tests/SentryTests/SentryOptionsTest.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ - (void)assertDefaultValues:(SentryOptions *)options
724724
XCTAssertEqual(YES, options.enableWatchdogTerminationTracking);
725725
XCTAssertEqual([@30000 unsignedIntValue], options.sessionTrackingIntervalMillis);
726726
XCTAssertEqual(YES, options.attachStacktrace);
727-
XCTAssertEqual(20 * 1024 * 1024, options.maxAttachmentSize);
727+
XCTAssertEqual(100 * 1024 * 1024, options.maxAttachmentSize);
728728
XCTAssertEqual(NO, options.sendDefaultPii);
729729
XCTAssertTrue(options.enableAutoPerformanceTracing);
730730
#if SENTRY_HAS_UIKIT
@@ -844,7 +844,7 @@ - (void)testDefaultMaxAttachmentSize
844844
{
845845
SentryOptions *options = [self getValidOptions:@{}];
846846

847-
XCTAssertEqual(20 * 1024 * 1024, options.maxAttachmentSize);
847+
XCTAssertEqual(100 * 1024 * 1024, options.maxAttachmentSize);
848848
}
849849

850850
- (void)testSendDefaultPii

0 commit comments

Comments
 (0)