{"action":"created","issue":{"url":"https://api.github.com/repos/keybase/client/issues/2784","repository_url":"https://api.github.com/repos/keybase/client","labels_url":"https://api.github.com/repos/keybase/client/issues/2784/labels{/name}","comments_url":"https://api.github.com/repos/keybase/client/issues/2784/comments","events_url":"https://api.github.com/repos/keybase/client/issues/2784/events","html_url":"https://github.com/keybase/client/pull/2784","id":153482669,"number":2784,"title":"Don't delete kids from ComputedKeyInfos on revoke","user":{"login":"cjb","id":21217,"avatar_url":"https://avatars.githubusercontent.com/u/21217?v=3","gravatar_id":"","url":"https://api.github.com/users/cjb","html_url":"https://github.com/cjb","followers_url":"https://api.github.com/users/cjb/followers","following_url":"https://api.github.com/users/cjb/following{/other_user}","gists_url":"https://api.github.com/users/cjb/gists{/gist_id}","starred_url":"https://api.github.com/users/cjb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjb/subscriptions","organizations_url":"https://api.github.com/users/cjb/orgs","repos_url":"https://api.github.com/users/cjb/repos","events_url":"https://api.github.com/users/cjb/events{/privacy}","received_events_url":"https://api.github.com/users/cjb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-06T15:55:58Z","updated_at":"2016-05-06T16:08:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/keybase/client/pulls/2784","html_url":"https://github.com/keybase/client/pull/2784","diff_url":"https://github.com/keybase/client/pull/2784.diff","patch_url":"https://github.com/keybase/client/pull/2784.patch"},"body":"Before this PR, if you do the following:\r\n\r\n* sign up a new user\r\n* provision a device1\r\n* deprovision the device1\r\n* login again and create a device2\r\n\r\nThen the deviceHistoryRPC will fail with:\r\n```\r\n2016-05-06T11:35:12.255571 ▶ [WARN keybase rpc_exim.go:167] b28 not exportable error: device 6876a9ddda60b262f031d101ae094318 provisioned by kid 012039c68fe20ef741cf443ebde3ca8b9b3f229908e399f220293376b66c6ee8c8dc0a, but couldn't find matching device ID in ComputedKeyInfos (*errors.errorString)\r\n```\r\n\r\nIt's true, device1's kid is no longer in ComputedKeyInfos.  It was removed by this code, added in de8686bde07:\r\n```go\r\n\t// Clear out the old Key that this device used to refer to.\r\n\t// We might wind up just clobbering it with the same thing, but\r\n\t// that's fine for now.\r\n\tif prevKid.IsValid() {\r\n\t\tckf.G().Log.Debug(\"| Clear out old key\")\r\n\t\tdelete(ckf.cki.KIDToDeviceID, prevKid)\r\n\t}\r\n\r\n\tif kid.IsValid() {\r\n\t\tckf.cki.KIDToDeviceID[kid] = did\r\n\t}\r\n```\r\n.. because \"kid\" is null in this case.  You can see that it's null in the sigchain by looking here:\r\n\r\nhttps://stage0.keybase.io/cjbrev2/chain (#5)\r\n\r\n@oconnor663 proposes this change to make both conditions (prevKid && kid) necessary to perform the delete.\r\n\r\nr? @patrickxb || @maxtaco"},"comment":{"url":"https://api.github.com/repos/keybase/client/issues/comments/217486134","html_url":"https://github.com/keybase/client/pull/2784#issuecomment-217486134","issue_url":"https://api.github.com/repos/keybase/client/issues/2784","id":217486134,"user":{"login":"oconnor663","id":860932,"avatar_url":"https://avatars.githubusercontent.com/u/860932?v=3","gravatar_id":"","url":"https://api.github.com/users/oconnor663","html_url":"https://github.com/oconnor663","followers_url":"https://api.github.com/users/oconnor663/followers","following_url":"https://api.github.com/users/oconnor663/following{/other_user}","gists_url":"https://api.github.com/users/oconnor663/gists{/gist_id}","starred_url":"https://api.github.com/users/oconnor663/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oconnor663/subscriptions","organizations_url":"https://api.github.com/users/oconnor663/orgs","repos_url":"https://api.github.com/users/oconnor663/repos","events_url":"https://api.github.com/users/oconnor663/events{/privacy}","received_events_url":"https://api.github.com/users/oconnor663/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T16:08:35Z","updated_at":"2016-05-06T16:08:35Z","body":"I think the intended semantics of the `device` block in sigchain links, is that any field that's omitted from later links that use the same device ID, just means \"keep the previous value\". So leaving the `kid` out of the `device` section in a revoke link doesn't mean \"this device, in addition to being revoked, is no longer associated with any kid\" but rather \"the kid this device is associated with hasn't changed\".\r\n\r\n@maxtaco when you get a chance to look at this, let me know if there's some other reason we wrote this the way we did, that I might've forgotten?"}}