Skip to content

Conversation

@philprime
Copy link
Member

@philprime philprime commented Nov 10, 2025

📜 Description

Bumps the maxAttachmentSize in SentryOptions from 100MB to 200MB.

💡 Motivation and Context

This change aligns the SDK's default maxAttachmentSize with the updated Sentry relay limits. The new limits are: 40MB for a compressed envelope request, 200MB for a full envelope after decompression, 200MB for all attachments combined, and 200MB for each individual attachment item. This update prevents attachments from being unnecessarily discarded by the relay.

Fixes #6537

💚 How did you test it?

Updated existing unit tests in SentryOptionsTest.m to reflect the new default value and verified they pass.

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

Slack Thread

Open in Cursor Open in Web

Updates the maximum attachment size limit to align with the latest
Sentry relay limits as documented in:
https://develop.sentry.dev/sdk/data-model/envelopes/#size-limits

Changes:
- Increased maxAttachmentSize default from 100MB to 200MB
- Updated documentation in SentryOptions.h
- Updated unit tests in SentryOptionsTest.m

This change supports the following envelope size limits:
- 40MB for compressed envelope requests
- 200MB for full envelope after decompression
- 200MB for all attachments combined
- 200MB for each individual attachment item

Relates to: #6537
@cursor
Copy link

cursor bot commented Nov 10, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@philprime philprime self-assigned this Nov 10, 2025
@philprime philprime changed the title Update max attachment size in Sentry options refactor: Update max attachment size in Sentry options Nov 10, 2025
@philprime philprime added the ready-to-merge Use this label to trigger all PR workflows label Nov 10, 2025
@philprime philprime marked this pull request as ready for review November 10, 2025 08:52
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.069%. Comparing base (f41cbcd) to head (ff79bcf).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #6726       +/-   ##
=============================================
+ Coverage   85.051%   85.069%   +0.018%     
=============================================
  Files          452       452               
  Lines        27649     27649               
  Branches     12144     12144               
=============================================
+ Hits         23516     23521        +5     
+ Misses        4087      4085        -2     
+ Partials        46        43        -3     
Files with missing lines Coverage Δ
Sources/Swift/Options.swift 97.163% <100.000%> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f41cbcd...ff79bcf. Read the comment docs.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this PR definitely deserves a changelog entry.

@philprime philprime enabled auto-merge (squash) November 11, 2025 16:19
@github-actions
Copy link
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1225.33 ms 1248.78 ms 23.45 ms
Size 24.14 KiB 1.01 MiB 1011.56 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4a7a005 1229.15 ms 1243.35 ms 14.20 ms
5b44596 1220.87 ms 1247.27 ms 26.40 ms
2137530 1223.39 ms 1253.25 ms 29.86 ms
32f2329 1224.36 ms 1257.33 ms 32.98 ms
b9c733a 1195.49 ms 1220.23 ms 24.74 ms
c8420eb 1214.16 ms 1246.22 ms 32.06 ms
492686a 1230.82 ms 1255.82 ms 25.00 ms
72a8746 1215.23 ms 1259.22 ms 43.99 ms
51f74d7 1236.31 ms 1247.43 ms 11.12 ms
e9f483c 1224.60 ms 1260.00 ms 35.40 ms

App size

Revision Plain With Sentry Diff
4a7a005 23.75 KiB 979.96 KiB 956.22 KiB
5b44596 23.75 KiB 1.00 MiB 1002.41 KiB
2137530 23.75 KiB 933.33 KiB 909.58 KiB
32f2329 23.75 KiB 1.01 MiB 1016.02 KiB
b9c733a 23.74 KiB 1021.49 KiB 997.74 KiB
c8420eb 23.75 KiB 995.83 KiB 972.09 KiB
492686a 23.75 KiB 1.01 MiB 1016.13 KiB
72a8746 23.74 KiB 976.79 KiB 953.05 KiB
51f74d7 23.74 KiB 874.08 KiB 850.34 KiB
e9f483c 23.75 KiB 1022.77 KiB 999.03 KiB

@philprime philprime merged commit c79fd90 into main Nov 12, 2025
189 of 190 checks passed
@philprime philprime deleted the cursor/update-max-attachment-size-in-sentry-options-5dfe branch November 12, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Use this label to trigger all PR workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants