-
Notifications
You must be signed in to change notification settings - Fork 130
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
Convert event.device from NSDictionary to a structured class #526
Conversation
197449a
to
8e72aea
Compare
8e72aea
to
bd246e3
Compare
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.
Looks good in the main. A couple of simplifying refactorings that seem to make sense in the context of the move to structured device info have been suggested; probably worth scanning all the comments once over. One outstanding question I have is over what looks like the removal of the wordSize
field from session device payloads. Understanding that decision would be useful.
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.
Thanks for the changes, looks good!
Goal
Converts
event.device
from anNSDictionary
to a structured class where each field is represented as a property.BugsnagDevice
is used for sessions, and contains stateless properties that do not change over the lifecycle of an application.BugsnagDeviceWithState
extends this class and is used for events, and contains stateful properties that change for each error - e.g.freeDisk
.Changeset
BugsnagDevice
andBugsnagDeviceWithState
classes with properties for each field in the specBugsnagEvent
to use readonlyBugsnagDeviceWithState
forevent.device
BSGParseDevice
andBSGParseDeviceWithState
methods into newBugsnagDevice
classes, so that they can parse a KSCrash report and populate their fieldsBugsnagDevice/WithState
fromBugsnagEvent
event.metadata
Tests
BugsnagDevice
andBugsnagDeviceWithState
populate correctly, and that they serialize JSON correctly