Open
Conversation
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
|
sentry-android-ndk/src/main/java/io/sentry/android/ndk/NdkScopeObserver.java
Show resolved
Hide resolved
…try/sentry-java into feat/sync-file-attachment
Sentry Build Distribution
|
romtsn
reviewed
Mar 20, 2026
| return; | ||
| } | ||
|
|
||
| final byte[] bytes = attachment.getBytes(); |
Member
There was a problem hiding this comment.
there's also attachment.getByteProvider() which lazily evaluates and retrieves the bytes -- not sure if you want to support that from the gaming SDKs, but we use it when getting the bytes is heavy for the main thread, so it gets offloaded to the envelope serialization time on a bg thread, e.g.
Contributor
Author
There was a problem hiding this comment.
I think invoking the ByteProvider from inside the signal handler is going to be extremely risky. But I'll keep that in mind.
bitsandfoxes
commented
Mar 20, 2026
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8687935 | 332.52 ms | 362.23 ms | 29.71 ms |
| 27d7cf8 | 309.43 ms | 364.27 ms | 54.85 ms |
| f064536 | 329.00 ms | 395.62 ms | 66.62 ms |
| abfcc92 | 337.38 ms | 427.39 ms | 90.00 ms |
| ae7fed0 | 293.84 ms | 380.22 ms | 86.38 ms |
| d15471f | 361.89 ms | 378.07 ms | 16.18 ms |
| 1df7eb6 | 397.04 ms | 429.64 ms | 32.60 ms |
| 9fbb112 | 401.87 ms | 515.87 ms | 114.00 ms |
| 6405ec5 | 310.88 ms | 354.56 ms | 43.69 ms |
| 62b579c | 318.48 ms | 367.71 ms | 49.24 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8687935 | 1.58 MiB | 2.19 MiB | 619.17 KiB |
| 27d7cf8 | 1.58 MiB | 2.12 MiB | 549.42 KiB |
| f064536 | 1.58 MiB | 2.20 MiB | 633.90 KiB |
| abfcc92 | 1.58 MiB | 2.13 MiB | 557.31 KiB |
| ae7fed0 | 1.58 MiB | 2.12 MiB | 551.77 KiB |
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
| 1df7eb6 | 1.58 MiB | 2.10 MiB | 532.97 KiB |
| 9fbb112 | 1.58 MiB | 2.11 MiB | 539.18 KiB |
| 6405ec5 | 1.58 MiB | 2.12 MiB | 552.23 KiB |
| 62b579c | 0 B | 0 B | 0 B |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Relies on getsentry/sentry-native#1584
Attachments added to the scope should get synced to
sentry-native. I.e. a Unity games hasand the game crashes, that attachment should be available in the resulting sentry event.
💡 Motivation and Context
Resolves #4758
💚 How did you test it?
Unit tests. Unity SDK will have e2e tests.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
This needs to be used and implemented in the hybrid SDKs.
Adding support to sync
bytesas attachments.