{"action":"created","comment":{"url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls/comments/202978536","pull_request_review_id":137775638,"id":202978536,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjk3ODUzNg==","diff_hunk":"@@ -85,17 +85,12 @@\n     return appState;\n }\n \n-NSDictionary *BSGParseAppState(NSDictionary *report) {\n-    NSDictionary *system = report[BSGKeySystem];\n+NSDictionary *BSGParseAppState(NSDictionary *report, NSString *preferredVersion) {\n     NSMutableDictionary *app = [NSMutableDictionary dictionary];\n \n-    NSString *version = [report valueForKeyPath:@\"user.config.appVersion\"];\n-\n-    if (!version) {\n-        version = system[@\"CFBundleShortVersionString\"];\n-    }\n+    NSString *version = preferredVersion ?: report[@\"CFBundleShortVersionString\"];\n \n-    BSGDictSetSafeObject(app, system[@\"CFBundleVersion\"], @\"bundleVersion\");\n+    BSGDictSetSafeObject(app, report[@\"CFBundleVersion\"], @\"bundleVersion\");","path":"Source/BugsnagKSCrashSysInfoParser.m","position":17,"original_position":17,"commit_id":"861b493dfe2946bc8510def2c2784faf6384f548","original_commit_id":"70d16ff2daec4011ef0e6d7e17e5ecd035bcb5db","user":{"login":"kattrali","id":333454,"node_id":"MDQ6VXNlcjMzMzQ1NA==","avatar_url":"https://avatars2.githubusercontent.com/u/333454?v=4","gravatar_id":"","url":"https://api.github.com/users/kattrali","html_url":"https://github.com/kattrali","followers_url":"https://api.github.com/users/kattrali/followers","following_url":"https://api.github.com/users/kattrali/following{/other_user}","gists_url":"https://api.github.com/users/kattrali/gists{/gist_id}","starred_url":"https://api.github.com/users/kattrali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kattrali/subscriptions","organizations_url":"https://api.github.com/users/kattrali/orgs","repos_url":"https://api.github.com/users/kattrali/repos","events_url":"https://api.github.com/users/kattrali/events{/privacy}","received_events_url":"https://api.github.com/users/kattrali/received_events","type":"User","site_admin":false},"body":"Maybe; I want to think about how we are doing key constants a bit in the meantime in case there's an easy way to both define and find the right ones.","created_at":"2018-07-17T10:57:59Z","updated_at":"2018-07-17T10:57:59Z","html_url":"https://github.com/bugsnag/bugsnag-cocoa/pull/296#discussion_r202978536","pull_request_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls/296","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls/comments/202978536"},"html":{"href":"https://github.com/bugsnag/bugsnag-cocoa/pull/296#discussion_r202978536"},"pull_request":{"href":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls/296"}},"in_reply_to_id":202817837},"pull_request":{"url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls/296","id":201748850,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNzQ4ODUw","html_url":"https://github.com/bugsnag/bugsnag-cocoa/pull/296","diff_url":"https://github.com/bugsnag/bugsnag-cocoa/pull/296.diff","patch_url":"https://github.com/bugsnag/bugsnag-cocoa/pull/296.patch","issue_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/issues/296","number":296,"state":"open","locked":false,"title":"fix: Parse system info from root if no nested system dictionary exists","user":{"login":"kattrali","id":333454,"node_id":"MDQ6VXNlcjMzMzQ1NA==","avatar_url":"https://avatars2.githubusercontent.com/u/333454?v=4","gravatar_id":"","url":"https://api.github.com/users/kattrali","html_url":"https://github.com/kattrali","followers_url":"https://api.github.com/users/kattrali/followers","following_url":"https://api.github.com/users/kattrali/following{/other_user}","gists_url":"https://api.github.com/users/kattrali/gists{/gist_id}","starred_url":"https://api.github.com/users/kattrali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kattrali/subscriptions","organizations_url":"https://api.github.com/users/kattrali/orgs","repos_url":"https://api.github.com/users/kattrali/repos","events_url":"https://api.github.com/users/kattrali/events{/privacy}","received_events_url":"https://api.github.com/users/kattrali/received_events","type":"User","site_admin":false},"body":"In reports, the base report has a “system” dict for system info.\r\n\r\nSessions rely on the raw info parser to gather app and device data, \r\nwhich is not nested in a separate “system” dict. \r\n\r\n## Goal\r\n\r\nThe changes in #292 fixed sending a custom version for reports but\r\nbroke app version parsing for sessions. This change refactors app\r\nstate parsing slightly to ensure both reports and sessions fetch the\r\ncorrect app state (and custom versions, if provided).\r\n\r\n## Changeset\r\n\r\nMoved the top level version parsing out to error reports from `BSGParseAppState`. The preferred app version is now (optionally) specified up front.\r\n\r\n```diff\r\n- BSGParseAppState(errorReport)\r\n+ BSGParseAppState(sysInfo, preferredVersion)\r\n```\r\n\r\n## Tests\r\n\r\nAdded new integration test cases for verifying app version with or without custom versions set.\r\n\r\n## Review\r\n\r\nFor the submitter, initial self-review:\r\n\r\n- [x] Commented on code changes inline explain the reasoning behind the approach\r\n- [x] Reviewed the test cases added for completeness and possible points for discussion\r\n- [x] A changelog entry was added for the goal of this pull request\r\n- [x] Check the scope of the changeset - is everything in the diff required for the pull request?\r\n- This pull request is ready for:\r\n  - [x] Initial review of the intended approach, not yet feature complete\r\n  - [x] Structural review of the classes, functions, and properties modified\r\n  - [x] Final review\r\n\r\nFor the pull request reviewer(s), this changeset has been reviewed for:\r\n\r\n- [ ] Consistency across platforms for structures or concepts added or modified\r\n- [ ] Consistency between the changeset and the goal stated above\r\n- [ ] Internal consistency with the rest of the library - is there any overlap between existing interfaces and any which have been added?\r\n- [ ] Usage friction - is the proposed change in usage cumbersome or complicated?\r\n- [ ] Performance and complexity - are there any cases of unexpected O(n^3) when iterating, recursing, flat mapping, etc?\r\n- [ ] Concurrency concerns - if components are accessed asynchronously, what issues will arise\r\n- [ ] Thoroughness of added tests and any missing edge cases\r\n- [ ] Idiomatic use of the language\r\n","created_at":"2018-07-16T20:19:16Z","updated_at":"2018-07-17T10:57:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59f0ba5e10fbb77e1c5eac350c17f325e19e29b4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls/296/commits","review_comments_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls/296/comments","review_comment_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/issues/296/comments","statuses_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/statuses/861b493dfe2946bc8510def2c2784faf6384f548","head":{"label":"bugsnag:kattrali/session-verify-app-version","ref":"kattrali/session-verify-app-version","sha":"861b493dfe2946bc8510def2c2784faf6384f548","user":{"login":"bugsnag","id":1058895,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTg4OTU=","avatar_url":"https://avatars2.githubusercontent.com/u/1058895?v=4","gravatar_id":"","url":"https://api.github.com/users/bugsnag","html_url":"https://github.com/bugsnag","followers_url":"https://api.github.com/users/bugsnag/followers","following_url":"https://api.github.com/users/bugsnag/following{/other_user}","gists_url":"https://api.github.com/users/bugsnag/gists{/gist_id}","starred_url":"https://api.github.com/users/bugsnag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bugsnag/subscriptions","organizations_url":"https://api.github.com/users/bugsnag/orgs","repos_url":"https://api.github.com/users/bugsnag/repos","events_url":"https://api.github.com/users/bugsnag/events{/privacy}","received_events_url":"https://api.github.com/users/bugsnag/received_events","type":"Organization","site_admin":false},"repo":{"id":12458757,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQ1ODc1Nw==","name":"bugsnag-cocoa","full_name":"bugsnag/bugsnag-cocoa","owner":{"login":"bugsnag","id":1058895,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTg4OTU=","avatar_url":"https://avatars2.githubusercontent.com/u/1058895?v=4","gravatar_id":"","url":"https://api.github.com/users/bugsnag","html_url":"https://github.com/bugsnag","followers_url":"https://api.github.com/users/bugsnag/followers","following_url":"https://api.github.com/users/bugsnag/following{/other_user}","gists_url":"https://api.github.com/users/bugsnag/gists{/gist_id}","starred_url":"https://api.github.com/users/bugsnag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bugsnag/subscriptions","organizations_url":"https://api.github.com/users/bugsnag/orgs","repos_url":"https://api.github.com/users/bugsnag/repos","events_url":"https://api.github.com/users/bugsnag/events{/privacy}","received_events_url":"https://api.github.com/users/bugsnag/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bugsnag/bugsnag-cocoa","description":"Bugsnag crash reporting for iOS, macOS, and tvOS apps","fork":false,"url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa","forks_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/forks","keys_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/teams","hooks_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/hooks","issue_events_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/issues/events{/number}","events_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/events","assignees_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/assignees{/user}","branches_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/branches{/branch}","tags_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/tags","blobs_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/git/refs{/sha}","trees_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/statuses/{sha}","languages_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/languages","stargazers_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/stargazers","contributors_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/contributors","subscribers_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/subscribers","subscription_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/subscription","commits_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/commits{/sha}","git_commits_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/git/commits{/sha}","comments_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/comments{/number}","issue_comment_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/issues/comments{/number}","contents_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/contents/{+path}","compare_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/merges","archive_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/downloads","issues_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/issues{/number}","pulls_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls{/number}","milestones_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/milestones{/number}","notifications_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/labels{/name}","releases_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/releases{/id}","deployments_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/deployments","created_at":"2013-08-29T11:44:03Z","updated_at":"2018-07-16T16:20:43Z","pushed_at":"2018-07-17T08:41:44Z","git_url":"git://github.com/bugsnag/bugsnag-cocoa.git","ssh_url":"git@github.com:bugsnag/bugsnag-cocoa.git","clone_url":"https://github.com/bugsnag/bugsnag-cocoa.git","svn_url":"https://github.com/bugsnag/bugsnag-cocoa","homepage":"https://docs.bugsnag.com/platforms/ios","size":2777,"stargazers_count":105,"watchers_count":105,"language":"Objective-C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":62,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":62,"open_issues":7,"watchers":105,"default_branch":"master"}},"base":{"label":"bugsnag:master","ref":"master","sha":"938717412cda1a839a65e912f4a396ccfdbaea83","user":{"login":"bugsnag","id":1058895,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTg4OTU=","avatar_url":"https://avatars2.githubusercontent.com/u/1058895?v=4","gravatar_id":"","url":"https://api.github.com/users/bugsnag","html_url":"https://github.com/bugsnag","followers_url":"https://api.github.com/users/bugsnag/followers","following_url":"https://api.github.com/users/bugsnag/following{/other_user}","gists_url":"https://api.github.com/users/bugsnag/gists{/gist_id}","starred_url":"https://api.github.com/users/bugsnag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bugsnag/subscriptions","organizations_url":"https://api.github.com/users/bugsnag/orgs","repos_url":"https://api.github.com/users/bugsnag/repos","events_url":"https://api.github.com/users/bugsnag/events{/privacy}","received_events_url":"https://api.github.com/users/bugsnag/received_events","type":"Organization","site_admin":false},"repo":{"id":12458757,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQ1ODc1Nw==","name":"bugsnag-cocoa","full_name":"bugsnag/bugsnag-cocoa","owner":{"login":"bugsnag","id":1058895,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTg4OTU=","avatar_url":"https://avatars2.githubusercontent.com/u/1058895?v=4","gravatar_id":"","url":"https://api.github.com/users/bugsnag","html_url":"https://github.com/bugsnag","followers_url":"https://api.github.com/users/bugsnag/followers","following_url":"https://api.github.com/users/bugsnag/following{/other_user}","gists_url":"https://api.github.com/users/bugsnag/gists{/gist_id}","starred_url":"https://api.github.com/users/bugsnag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bugsnag/subscriptions","organizations_url":"https://api.github.com/users/bugsnag/orgs","repos_url":"https://api.github.com/users/bugsnag/repos","events_url":"https://api.github.com/users/bugsnag/events{/privacy}","received_events_url":"https://api.github.com/users/bugsnag/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bugsnag/bugsnag-cocoa","description":"Bugsnag crash reporting for iOS, macOS, and tvOS apps","fork":false,"url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa","forks_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/forks","keys_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/teams","hooks_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/hooks","issue_events_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/issues/events{/number}","events_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/events","assignees_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/assignees{/user}","branches_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/branches{/branch}","tags_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/tags","blobs_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/git/refs{/sha}","trees_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/statuses/{sha}","languages_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/languages","stargazers_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/stargazers","contributors_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/contributors","subscribers_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/subscribers","subscription_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/subscription","commits_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/commits{/sha}","git_commits_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/git/commits{/sha}","comments_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/comments{/number}","issue_comment_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/issues/comments{/number}","contents_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/contents/{+path}","compare_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/merges","archive_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/downloads","issues_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/issues{/number}","pulls_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls{/number}","milestones_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/milestones{/number}","notifications_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/labels{/name}","releases_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/releases{/id}","deployments_url":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/deployments","created_at":"2013-08-29T11:44:03Z","updated_at":"2018-07-16T16:20:43Z","pushed_at":"2018-07-17T08:41:44Z","git_url":"git://github.com/bugsnag/bugsnag-cocoa.git","ssh_url":"git@github.com:bugsnag/bugsnag-cocoa.git","clone_url":"https://github.com/bugsnag/bugsnag-cocoa.git","svn_url":"https://github.com/bugsnag/bugsnag-cocoa","homepage":"https://docs.bugsnag.com/platforms/ios","size":2777,"stargazers_count":105,"watchers_count":105,"language":"Objective-C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":62,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":62,"open_issues":7,"watchers":105,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls/296"},"html":{"href":"https://github.com/bugsnag/bugsnag-cocoa/pull/296"},"issue":{"href":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/issues/296"},"comments":{"href":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/issues/296/comments"},"review_comments":{"href":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls/296/comments"},"review_comment":{"href":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/pulls/296/commits"},"statuses":{"href":"https://api.github.com/repos/bugsnag/bugsnag-cocoa/statuses/861b493dfe2946bc8510def2c2784faf6384f548"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"kattrali"}}