Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing OS context for iOS events #958

Merged
merged 4 commits into from Jul 25, 2022
Merged

Fix missing OS context for iOS events #958

merged 4 commits into from Jul 25, 2022

Conversation

marandaneto
Copy link
Contributor

@marandaneto marandaneto commented Jul 24, 2022

馃摐 Description

Fix missing OS context for iOS events

馃挕 Motivation and Context

Fix #942

馃挌 How did you test it?

馃摑 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

馃敭 Next steps

getsentry/team-mobile#11

Comment on lines +194 to +199
if (key == SentryOperatingSystem.type &&
currentValue is SentryOperatingSystem &&
value is SentryOperatingSystem) {
final osMap = {...value.toJson(), ...currentValue.toJson()};
final os = SentryOperatingSystem.fromJson(osMap);
eventContexts[key] = os;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a quick workaround for now, the whole process of merging contexts from the Native and Dart layer should be done differently.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#942
Flutter sets the os.theme by default, so when merging the contexts, it does not take the os from the iOS layer since we don't merge field per field recursively, but rather if the key exists or not.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I see. Yeah, that's a stupid behavior.

@codecov-commenter
Copy link

codecov-commenter commented Jul 24, 2022

Codecov Report

Merging #958 (4643998) into main (94daf24) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #958   +/-   ##
=======================================
  Coverage   89.52%   89.52%           
=======================================
  Files         105      105           
  Lines        3292     3292           
=======================================
  Hits         2947     2947           
  Misses        345      345           

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 94daf24...4643998. Read the comment docs.

@marandaneto marandaneto changed the title Fix missing OS for iOS Fix missing OS context for iOS events Jul 25, 2022
@marandaneto marandaneto marked this pull request as ready for review July 25, 2022 07:21
Copy link
Collaborator

@brustolin brustolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marandaneto marandaneto merged commit 7011abe into main Jul 25, 2022
@marandaneto marandaneto deleted the fix/missing-ios-os branch July 25, 2022 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues reported as "Unknown OS"
4 participants