-
-
Notifications
You must be signed in to change notification settings - Fork 19
fix: beforeSend overriding default values even if they were 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.32% -0.61%
==========================================
Files 44 11 -33
Lines 812 324 -488
Branches 108 49 -59
==========================================
- Hits 649 257 -392
+ Misses 107 39 -68
+ Partials 56 28 -28 ☔ 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 cocoa like this since the SentryEvent
in java is final and we don't use a mocking framework yet
📜 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