Fix: Remove is Enum check to support older Dart versions#635
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #635 +/- ##
==========================================
- Coverage 90.29% 90.28% -0.02%
==========================================
Files 93 93
Lines 3041 3035 -6
==========================================
- Hits 2746 2740 -6
Misses 295 295 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| expect(jsonSerializationFallback(SentryOrientation.landscape), | ||
| 'SentryOrientation.landscape'); |
There was a problem hiding this comment.
for known SDK types this is not a problem
See https://github.com/getsentry/sentry-dart/blob/main/dart/lib/src/protocol/sentry_device.dart#L178-L194
this is only for unknown types set dynamically by the user.
|
Can we add some way for the user to specify the fallback themselves? |
since you are setting types that the SDK don't know during ser/deser, instead of setting the object itself, you could simply set the serialized version already. |
philipphofmann
left a comment
There was a problem hiding this comment.
It's hard for me to evaluate if this change is fine as I have no experience with Dart. The only thing I can point out is that we should add tests for this if possible. If there are tests, why didn't we have to change them?
no afaik dart-lang/sdk#7238 |
tests were modified, see utils_test.dart |
`Instructions and example for changelog`$
To the changelog entry, please add a link to this PR (consider a more descriptive message):` - Remove is Enum check to support older Dart versions(#635)
|
That should be pretty straight forward to implement, in the SDK. |
it'd be easy, but not sure if it's worth it, there are many ways of solving it on client-side only, another one would be overwriting |
|
I agree, it's fine to handle manually on my side. Just need to know. |
📜 Description
Fix: Remove is Enum check to support older Dart versions
💡 Motivation and Context
Closes #634
💚 How did you test it?
📝 Checklist
🔮 Next steps
#636