Conversation
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
c6cc055 to
2f13317
Compare
Co-authored-by: sentry-warden[bot] <258096371+sentry-warden[bot]@users.noreply.github.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5038 +/- ##
==========================================
+ Coverage 73.94% 74.02% +0.07%
==========================================
Files 497 499 +2
Lines 17974 18065 +91
Branches 3517 3518 +1
==========================================
+ Hits 13291 13372 +81
- Misses 3825 3835 +10
Partials 858 858 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| { | ||
| other.AddAttachment(attachment); | ||
| // Set the attachment directly to avoid triggering a scope sync | ||
| other._attachments.Add(attachment); |
There was a problem hiding this comment.
The pushing and popping the scope does not get propagated to the native layer. So syncing the same attachments again doesn't make sense.
There was a problem hiding this comment.
Android and iOS would both be using Global mode anyway, so no pushing/popping of scopes.
I am wondering what this means for native AOT applications that are using the Native SDK though. For ASP.NET Core apps, for example, we wouldn't want attachments from one async local scope context to end up being synced to some 'global' scope in the native SDK (and an attachment from one request ending up being captured in a native event for a completely unrelated request).
To be clear, I'm not sure if this is possible - just a concern that popped up when you made this remark.
I've added a note to #5052 to investigate this before implementing for Native.
There was a problem hiding this comment.
an attachment from one request ending up being captured in a native event for a completely unrelated request)
A possible solution to this is to limit the attachment sync to global scope mode. That would also be a simple mental model: "global scope persists across all layers".
There was a problem hiding this comment.
A possible solution to this is to limit the attachment sync to global scope mode.
That's a good idea... I think probably the only safe way to do it 👍🏻
There was a problem hiding this comment.
This was actually just added in 0.13.3 of the Native SDK:
Added #5052 as a follow up:
|
@bitsandfoxes this looks fine. The only thing I'm wondering is whether we're likely to implement this for Android, iOS and Native... for native, I can see some potential issues. If we don't end up implementing for one/more of them, I guess we can just add some comments to the relevant @Flash0ver does that sound good to you? |
Yes. If we later don't actually have an implementation for native, |
Yes, both |

Relates to getsentry/sentry-native#1584 and getsentry/sentry-java#5211
Allows syncing attachments to native layers. This will require a followup to implement the actual Android/iOS scope sync but unblocks Unity SDK.
#skip-changelog