{"action":"created","comment":{"url":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls/comments/174144610","pull_request_review_id":103445928,"id":174144610,"diff_hunk":"@@ -177,43 +176,86 @@ class UserTests: QuickSpec {\n                 expect(user.tokens).toNot(beNil())\n             }\n \n-            it(\"Should emit set event\") {\n+            it(\"Should update tokens\") {\n                 let user = User(state: .loggedOut)\n-                var newTokens: TokenData?\n-                _ = user.didSetTokens.register { newTokens = $0.new }\n+                expect(user.tokens).to(beNil())\n                 _ = try? user.set(accessToken: \"hehe\", refreshToken: \"hehe\", idToken: \"hehe\")\n-                expect(newTokens).toNot(beNil())\n+                expect(user.tokens).toNot(beNil())\n             }\n \n-            it(\"Should not emit set event if set to same\") {\n+            it(\"Should not change tokens if set to same\") {\n                 let user = User(state: .loggedOut)\n-                var newTokens: TokenData?\n                 _ = try? user.set(accessToken: \"hehe\", refreshToken: \"hehe\", idToken: \"hehe\")\n-                _ = user.didSetTokens.register { newTokens = $0.new }\n+                let tokens = user.tokens\n+                expect(tokens).toNot(beNil())\n                 _ = try? user.set(accessToken: \"hehe\", refreshToken: \"hehe\", idToken: \"hehe\")\n-                expect(newTokens).to(beNil())\n+                expect(user.tokens) == tokens\n             }\n \n-            it(\"Should emit set event if any tokens set differently\") {\n+            it(\"Should update tokens if set differently\") {\n                 let user = User(state: .loggedOut)\n-                var newTokens: TokenData?\n-                _ = try? user.set(accessToken: \"hehe\", refreshToken: \"hehe\", idToken: \"hehe\", userID: \"hehe\")\n-                _ = user.didSetTokens.register { newTokens = $0.new }\n+                try? user.set(accessToken: \"hehe\", refreshToken: \"hehe\", idToken: \"hehe\", userID: \"hehe\")\n+                try? user.set(accessToken: \"hehe again\")\n+                expect(user.tokens).toNot(beNil())\n+                expect(user.tokens?.refreshToken) == \"hehe\"\n+                expect(user.tokens?.idToken) == \"hehe\"\n+                expect(user.tokens?.userID) == \"hehe\"\n \n-                _ = try? user.set(accessToken: \"hehe again\")\n-                expect(newTokens).toNot(beNil())\n-                newTokens = nil\n+                try? user.set(refreshToken: \"hehe again\")\n+                expect(user.tokens).toNot(beNil())\n+                expect(user.tokens?.refreshToken) == \"hehe again\"\n \n-                _ = try? user.set(refreshToken: \"hehe again\")\n-                expect(newTokens).toNot(beNil())\n-                newTokens = nil\n+                try? user.set(idToken: \"hehe again\")\n+                expect(user.tokens).toNot(beNil())\n+                expect(user.tokens?.idToken) == \"hehe again\"\n \n-                _ = try? user.set(idToken: \"hehe again\")\n-                expect(newTokens).toNot(beNil())\n-                newTokens = nil\n+                try? user.set(userID: \"hehe again\")\n+                expect(user.tokens).toNot(beNil())\n+                expect(user.tokens?.userID) == \"hehe again\"\n+            }\n+        }\n \n-                _ = try? user.set(userID: \"hehe again\")\n-                expect(newTokens).toNot(beNil())\n+        describe(\"Keychain management\") {\n+            it(\"Should not treat the user as logged in if it does not find keychain data\") {\n+                let user = User(state: .loggedOut)","path":"Example/Tests/UserTests.swift","position":84,"original_position":84,"commit_id":"bc09ca2f3e0eb55c65c33d408fe080e4fd15ff28","original_commit_id":"bc09ca2f3e0eb55c65c33d408fe080e4fd15ff28","user":{"login":"lrossi","id":2843411,"avatar_url":"https://avatars3.githubusercontent.com/u/2843411?v=4","gravatar_id":"","url":"https://api.github.com/users/lrossi","html_url":"https://github.com/lrossi","followers_url":"https://api.github.com/users/lrossi/followers","following_url":"https://api.github.com/users/lrossi/following{/other_user}","gists_url":"https://api.github.com/users/lrossi/gists{/gist_id}","starred_url":"https://api.github.com/users/lrossi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrossi/subscriptions","organizations_url":"https://api.github.com/users/lrossi/orgs","repos_url":"https://api.github.com/users/lrossi/repos","events_url":"https://api.github.com/users/lrossi/events{/privacy}","received_events_url":"https://api.github.com/users/lrossi/received_events","type":"User","site_admin":false},"body":"Correct 👍","created_at":"2018-03-13T14:12:16Z","updated_at":"2018-03-13T14:12:16Z","html_url":"https://github.com/schibsted/account-sdk-ios/pull/11#discussion_r174144610","pull_request_url":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls/11","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls/comments/174144610"},"html":{"href":"https://github.com/schibsted/account-sdk-ios/pull/11#discussion_r174144610"},"pull_request":{"href":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls/11"}},"in_reply_to_id":174140389},"pull_request":{"url":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls/11","id":174666277,"html_url":"https://github.com/schibsted/account-sdk-ios/pull/11","diff_url":"https://github.com/schibsted/account-sdk-ios/pull/11.diff","patch_url":"https://github.com/schibsted/account-sdk-ios/pull/11.patch","issue_url":"https://api.github.com/repos/schibsted/account-sdk-ios/issues/11","number":11,"state":"open","locked":false,"title":"Fix user tokens not cleared on logout if `IdentityManager` is not available","user":{"login":"lrossi","id":2843411,"avatar_url":"https://avatars3.githubusercontent.com/u/2843411?v=4","gravatar_id":"","url":"https://api.github.com/users/lrossi","html_url":"https://github.com/lrossi","followers_url":"https://api.github.com/users/lrossi/followers","following_url":"https://api.github.com/users/lrossi/following{/other_user}","gists_url":"https://api.github.com/users/lrossi/gists{/gist_id}","starred_url":"https://api.github.com/users/lrossi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrossi/subscriptions","organizations_url":"https://api.github.com/users/lrossi/orgs","repos_url":"https://api.github.com/users/lrossi/repos","events_url":"https://api.github.com/users/lrossi/events{/privacy}","received_events_url":"https://api.github.com/users/lrossi/received_events","type":"User","site_admin":false},"body":"Take # 2 🎬","created_at":"2018-03-13T13:52:27Z","updated_at":"2018-03-13T14:12:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b4468654d057f1646aafa2fbf4cce6450d88c5b0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls/11/commits","review_comments_url":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls/11/comments","review_comment_url":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/schibsted/account-sdk-ios/issues/11/comments","statuses_url":"https://api.github.com/repos/schibsted/account-sdk-ios/statuses/bc09ca2f3e0eb55c65c33d408fe080e4fd15ff28","head":{"label":"schibsted:fix-tokens-not-cleared-on-logout","ref":"fix-tokens-not-cleared-on-logout","sha":"bc09ca2f3e0eb55c65c33d408fe080e4fd15ff28","user":{"login":"schibsted","id":2492354,"avatar_url":"https://avatars0.githubusercontent.com/u/2492354?v=4","gravatar_id":"","url":"https://api.github.com/users/schibsted","html_url":"https://github.com/schibsted","followers_url":"https://api.github.com/users/schibsted/followers","following_url":"https://api.github.com/users/schibsted/following{/other_user}","gists_url":"https://api.github.com/users/schibsted/gists{/gist_id}","starred_url":"https://api.github.com/users/schibsted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schibsted/subscriptions","organizations_url":"https://api.github.com/users/schibsted/orgs","repos_url":"https://api.github.com/users/schibsted/repos","events_url":"https://api.github.com/users/schibsted/events{/privacy}","received_events_url":"https://api.github.com/users/schibsted/received_events","type":"Organization","site_admin":false},"repo":{"id":123893482,"name":"account-sdk-ios","full_name":"schibsted/account-sdk-ios","owner":{"login":"schibsted","id":2492354,"avatar_url":"https://avatars0.githubusercontent.com/u/2492354?v=4","gravatar_id":"","url":"https://api.github.com/users/schibsted","html_url":"https://github.com/schibsted","followers_url":"https://api.github.com/users/schibsted/followers","following_url":"https://api.github.com/users/schibsted/following{/other_user}","gists_url":"https://api.github.com/users/schibsted/gists{/gist_id}","starred_url":"https://api.github.com/users/schibsted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schibsted/subscriptions","organizations_url":"https://api.github.com/users/schibsted/orgs","repos_url":"https://api.github.com/users/schibsted/repos","events_url":"https://api.github.com/users/schibsted/events{/privacy}","received_events_url":"https://api.github.com/users/schibsted/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/schibsted/account-sdk-ios","description":"SchibstedAccount SDK for iOS","fork":false,"url":"https://api.github.com/repos/schibsted/account-sdk-ios","forks_url":"https://api.github.com/repos/schibsted/account-sdk-ios/forks","keys_url":"https://api.github.com/repos/schibsted/account-sdk-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/schibsted/account-sdk-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/schibsted/account-sdk-ios/teams","hooks_url":"https://api.github.com/repos/schibsted/account-sdk-ios/hooks","issue_events_url":"https://api.github.com/repos/schibsted/account-sdk-ios/issues/events{/number}","events_url":"https://api.github.com/repos/schibsted/account-sdk-ios/events","assignees_url":"https://api.github.com/repos/schibsted/account-sdk-ios/assignees{/user}","branches_url":"https://api.github.com/repos/schibsted/account-sdk-ios/branches{/branch}","tags_url":"https://api.github.com/repos/schibsted/account-sdk-ios/tags","blobs_url":"https://api.github.com/repos/schibsted/account-sdk-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/schibsted/account-sdk-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/schibsted/account-sdk-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/schibsted/account-sdk-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/schibsted/account-sdk-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/schibsted/account-sdk-ios/languages","stargazers_url":"https://api.github.com/repos/schibsted/account-sdk-ios/stargazers","contributors_url":"https://api.github.com/repos/schibsted/account-sdk-ios/contributors","subscribers_url":"https://api.github.com/repos/schibsted/account-sdk-ios/subscribers","subscription_url":"https://api.github.com/repos/schibsted/account-sdk-ios/subscription","commits_url":"https://api.github.com/repos/schibsted/account-sdk-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/schibsted/account-sdk-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/schibsted/account-sdk-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/schibsted/account-sdk-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/schibsted/account-sdk-ios/contents/{+path}","compare_url":"https://api.github.com/repos/schibsted/account-sdk-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/schibsted/account-sdk-ios/merges","archive_url":"https://api.github.com/repos/schibsted/account-sdk-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/schibsted/account-sdk-ios/downloads","issues_url":"https://api.github.com/repos/schibsted/account-sdk-ios/issues{/number}","pulls_url":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/schibsted/account-sdk-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/schibsted/account-sdk-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/schibsted/account-sdk-ios/labels{/name}","releases_url":"https://api.github.com/repos/schibsted/account-sdk-ios/releases{/id}","deployments_url":"https://api.github.com/repos/schibsted/account-sdk-ios/deployments","created_at":"2018-03-05T09:08:13Z","updated_at":"2018-03-12T15:04:09Z","pushed_at":"2018-03-13T13:54:02Z","git_url":"git://github.com/schibsted/account-sdk-ios.git","ssh_url":"git@github.com:schibsted/account-sdk-ios.git","clone_url":"https://github.com/schibsted/account-sdk-ios.git","svn_url":"https://github.com/schibsted/account-sdk-ios","homepage":null,"size":1015,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"schibsted:master","ref":"master","sha":"9ceefdf1796287850b51c23ea88682467acca326","user":{"login":"schibsted","id":2492354,"avatar_url":"https://avatars0.githubusercontent.com/u/2492354?v=4","gravatar_id":"","url":"https://api.github.com/users/schibsted","html_url":"https://github.com/schibsted","followers_url":"https://api.github.com/users/schibsted/followers","following_url":"https://api.github.com/users/schibsted/following{/other_user}","gists_url":"https://api.github.com/users/schibsted/gists{/gist_id}","starred_url":"https://api.github.com/users/schibsted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schibsted/subscriptions","organizations_url":"https://api.github.com/users/schibsted/orgs","repos_url":"https://api.github.com/users/schibsted/repos","events_url":"https://api.github.com/users/schibsted/events{/privacy}","received_events_url":"https://api.github.com/users/schibsted/received_events","type":"Organization","site_admin":false},"repo":{"id":123893482,"name":"account-sdk-ios","full_name":"schibsted/account-sdk-ios","owner":{"login":"schibsted","id":2492354,"avatar_url":"https://avatars0.githubusercontent.com/u/2492354?v=4","gravatar_id":"","url":"https://api.github.com/users/schibsted","html_url":"https://github.com/schibsted","followers_url":"https://api.github.com/users/schibsted/followers","following_url":"https://api.github.com/users/schibsted/following{/other_user}","gists_url":"https://api.github.com/users/schibsted/gists{/gist_id}","starred_url":"https://api.github.com/users/schibsted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schibsted/subscriptions","organizations_url":"https://api.github.com/users/schibsted/orgs","repos_url":"https://api.github.com/users/schibsted/repos","events_url":"https://api.github.com/users/schibsted/events{/privacy}","received_events_url":"https://api.github.com/users/schibsted/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/schibsted/account-sdk-ios","description":"SchibstedAccount SDK for iOS","fork":false,"url":"https://api.github.com/repos/schibsted/account-sdk-ios","forks_url":"https://api.github.com/repos/schibsted/account-sdk-ios/forks","keys_url":"https://api.github.com/repos/schibsted/account-sdk-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/schibsted/account-sdk-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/schibsted/account-sdk-ios/teams","hooks_url":"https://api.github.com/repos/schibsted/account-sdk-ios/hooks","issue_events_url":"https://api.github.com/repos/schibsted/account-sdk-ios/issues/events{/number}","events_url":"https://api.github.com/repos/schibsted/account-sdk-ios/events","assignees_url":"https://api.github.com/repos/schibsted/account-sdk-ios/assignees{/user}","branches_url":"https://api.github.com/repos/schibsted/account-sdk-ios/branches{/branch}","tags_url":"https://api.github.com/repos/schibsted/account-sdk-ios/tags","blobs_url":"https://api.github.com/repos/schibsted/account-sdk-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/schibsted/account-sdk-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/schibsted/account-sdk-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/schibsted/account-sdk-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/schibsted/account-sdk-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/schibsted/account-sdk-ios/languages","stargazers_url":"https://api.github.com/repos/schibsted/account-sdk-ios/stargazers","contributors_url":"https://api.github.com/repos/schibsted/account-sdk-ios/contributors","subscribers_url":"https://api.github.com/repos/schibsted/account-sdk-ios/subscribers","subscription_url":"https://api.github.com/repos/schibsted/account-sdk-ios/subscription","commits_url":"https://api.github.com/repos/schibsted/account-sdk-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/schibsted/account-sdk-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/schibsted/account-sdk-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/schibsted/account-sdk-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/schibsted/account-sdk-ios/contents/{+path}","compare_url":"https://api.github.com/repos/schibsted/account-sdk-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/schibsted/account-sdk-ios/merges","archive_url":"https://api.github.com/repos/schibsted/account-sdk-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/schibsted/account-sdk-ios/downloads","issues_url":"https://api.github.com/repos/schibsted/account-sdk-ios/issues{/number}","pulls_url":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/schibsted/account-sdk-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/schibsted/account-sdk-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/schibsted/account-sdk-ios/labels{/name}","releases_url":"https://api.github.com/repos/schibsted/account-sdk-ios/releases{/id}","deployments_url":"https://api.github.com/repos/schibsted/account-sdk-ios/deployments","created_at":"2018-03-05T09:08:13Z","updated_at":"2018-03-12T15:04:09Z","pushed_at":"2018-03-13T13:54:02Z","git_url":"git://github.com/schibsted/account-sdk-ios.git","ssh_url":"git@github.com:schibsted/account-sdk-ios.git","clone_url":"https://github.com/schibsted/account-sdk-ios.git","svn_url":"https://github.com/schibsted/account-sdk-ios","homepage":null,"size":1015,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls/11"},"html":{"href":"https://github.com/schibsted/account-sdk-ios/pull/11"},"issue":{"href":"https://api.github.com/repos/schibsted/account-sdk-ios/issues/11"},"comments":{"href":"https://api.github.com/repos/schibsted/account-sdk-ios/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/schibsted/account-sdk-ios/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/schibsted/account-sdk-ios/statuses/bc09ca2f3e0eb55c65c33d408fe080e4fd15ff28"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"lrossi"}}