-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Create User
and Breadcrumb
data classes from a Map
#59
Comments
The |
The hybrid SDKs are blocked because this need to be implemented on the native SDKs first. |
Please raise issues on the native SDKs to make it possible and move the status to blocked. |
@denrase we can add those methods directly in the native SDKs and use them here. |
IMO at first glance this looks nice, to create this once in the cocoa SDK and every other project make use of it. |
@marandaneto Do we still want to do this, as @brustolin has some reservations, at least for cocoa. On sentry-java we have the |
@brustolin both ways have trade-offs, the difference is that if something is wrong (something is missing, etc), you fix it only once on Cocoa, rather than multiple Hybrid SDKs, that alone already pays off IMO. |
Just to be clear, Im not against doing it. IMO is better for the hybrid SDK to no include this unnecessary extra dependency on the Core SDKs. If you really think this is the way to go I wont oppose it, @denrase can definitely include this in the cocoa SDK, no problem. If I remember correctly @philipphofmann has the same opinion, we already talked about this issue. |
Native SDKs should not swallow unknown properties, that's a feature that is implemented at least on Java/Android and some other SDKs. |
Let's put this on hold till @philipphofmann is back, so we can set up a meeting and talk about the pros and cons. |
We would need to iterate over every key in the dictionary to see if is a valid key. |
I wouldn't say it's extra dependency, we depend on the Core SDKs method anyway and if something changes we need to fix it in the Hybrid SDKs. Like this, it could be fixed only once as it was mentioned. |
@denrase I've talked to the Native SDK folks and they are fine with it, a few things to point out.
|
Use the "/Sentry/include/HybridPublic" directory to create new headers that expose this new features for hybrid SDKs. |
Often Hybrid SDKs have to create data classes out of a Map, See:
https://github.com/getsentry/sentry-dart/blob/b8b9b7b2608c35e4a3f7340ae9d2f0e9c06d984f/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt#L272-L286
This code is repeated for Android and iOS, on Flutter, RN, and others.
Ideally, Android and iOS would expose extension methods for this, such as:
User.fromMap(Map<String, Any> user)
.Breadcrumb.fromMap(Map<String, Any> crumb)
.Build in Core SDKs
User
andBreadcrumb
data classes from a dictionary sentry-cocoa#2687User
andBreadcrumb
data classes from a Map sentry-java#2534Use in Hybrid SDKs
The text was updated successfully, but these errors were encountered: