-
-
Notifications
You must be signed in to change notification settings - Fork 19
fix: beforeSend overriding default release even if it was not set #376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #376 +/- ##
==========================================
+ Coverage 79.92% 79.97% +0.04%
==========================================
Files 44 44
Lines 812 814 +2
Branches 108 110 +2
==========================================
+ Hits 649 651 +2
Misses 107 107
Partials 56 56 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
...in-multiplatform/src/commonMain/kotlin/io/sentry/kotlin/multiplatform/util/ApplyIfChanged.kt
Outdated
Show resolved
Hide resolved
I'll update this PR, let's fix it only for the release field now. I'm not even sure if the other fields need to be fixed like that as well |
|
||
// init with a SentryLevel as a workaround for: | ||
// Unable to call non-designated initializer as super constructor | ||
private class FakeSentryEvent : CocoaSentryEvent(Internal.Sentry.kSentryLevelFatal) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can only test on cocoa - on java the SentryEvent
is final and we don't use a mocking framework yet
@romtsn is this good to go? |
Updated dist as well. We don't expose |
📜 Description
We need to keep the KMP event model in sync with the native one. Users mainly edit events in KMP hooks like beforeSend, so we must track whether each field was actually modified:
If a field was changed, propagate the new value to the native event.• If it was untouched, leave the native default in place.
Previously we overwrote native defaults with null values by default e.g., Cocoa’s auto‑detected release was not working since we set a null release
💡 Motivation and Context
Fixes #337
💚 How did you test it?
TBD unit tests
📝 Checklist
You have to check all boxes before merging:
sendDefaultPII
is enabled.🔮 Next steps