-
-
Notifications
You must be signed in to change notification settings - Fork 358
fix: Remove internal unknown dict for Breadcrumbs #4803
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
Conversation
Remove unknown dict when initializing the crumbs with a dict added in #2820. The Java SDK, for example, implements this pattern to keep unknown JSON properties when deserializing and serializing classes. This allows more flexibility when a hybrid SDK or the native SDK serializes an event to disk, and the Java SDK deserializes this event. With the unknown dict, the Java SDK doesn't need to implement all the properties other SDKs have. We only have this for crumbs on the Cocoa SDK, and it doesn't make sense only to keep it for one class. Instead, we removed it to simplify the code because we would need to implement some complex deserialization logic with Swift Decodable for deserializing events. We can always reconsider this approach, but then we would need to add the unknown property concept for all serializable/decodable classes.
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
8f397a7 | 1219.12 ms | 1236.67 ms | 17.55 ms |
00cbe5c | 1233.57 ms | 1248.24 ms | 14.67 ms |
97de6c8 | 1226.78 ms | 1240.98 ms | 14.20 ms |
72c8d84 | 1257.34 ms | 1276.96 ms | 19.62 ms |
ef5821b | 1253.18 ms | 1265.46 ms | 12.28 ms |
e324230 | 1230.35 ms | 1236.45 ms | 6.10 ms |
89b12eb | 1236.02 ms | 1246.63 ms | 10.61 ms |
7cd187e | 1239.02 ms | 1261.42 ms | 22.40 ms |
7f14650 | 1236.00 ms | 1255.66 ms | 19.66 ms |
1734d1b | 1198.69 ms | 1221.62 ms | 22.93 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
8f397a7 | 20.76 KiB | 420.55 KiB | 399.79 KiB |
00cbe5c | 21.58 KiB | 573.16 KiB | 551.58 KiB |
97de6c8 | 21.58 KiB | 613.99 KiB | 592.41 KiB |
72c8d84 | 22.85 KiB | 408.88 KiB | 386.03 KiB |
ef5821b | 21.58 KiB | 414.96 KiB | 393.37 KiB |
e324230 | 22.85 KiB | 408.87 KiB | 386.02 KiB |
89b12eb | 20.76 KiB | 432.88 KiB | 412.11 KiB |
7cd187e | 20.76 KiB | 401.65 KiB | 380.89 KiB |
7f14650 | 22.84 KiB | 402.63 KiB | 379.78 KiB |
1734d1b | 21.58 KiB | 418.82 KiB | 397.24 KiB |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4803 +/- ##
=============================================
- Coverage 91.401% 91.392% -0.010%
=============================================
Files 627 627
Lines 74575 74553 -22
Branches 26834 26823 -11
=============================================
- Hits 68163 68136 -27
- Misses 6316 6321 +5
Partials 96 96
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
LGTM
RN doesn't use any unknown fields. |
📜 Description
Remove unknown dict when initializing the crumbs with a dict added in #2820. The Java SDK, for example, implements this pattern to keep unknown JSON properties when deserializing and serializing classes. This allows more flexibility when a hybrid SDK or the native SDK serializes an event to disk, and the Java SDK deserializes this event. With the unknown dict, the Java SDK doesn't need to implement all the properties other SDKs have. We only have this for crumbs on the Cocoa SDK, and it doesn't make sense only to keep it for one class. Instead, we removed it to simplify the code because we would need to implement some complex deserialization logic with Swift Decodable for deserializing events. We can always reconsider this approach, but then we would need to add the unknown property concept for all serializable/decodable classes.
💡 Motivation and Context
Came up in #4785
Communicated to .NET, RN and Flutter on Slack.
💚 How did you test it?
Unit tests.
📝 Checklist
You have to check all boxes before merging:
sendDefaultPII
is enabled.🔮 Next steps