{"action":"created","comment":{"url":"https://api.github.com/repos/keybase/client/pulls/comments/47261974","id":47261974,"diff_hunk":"@@ -0,0 +1,98 @@\n+/* @flow */\n+\n+import * as Constants from '../constants/pinentry'\n+\n+import type {Feature, GUIEntryFeatures, GUIEntryArg} from '../constants/types/flow-types'\n+import type {PinentryActions, NewPinentryAction, RegisterPinentryListenerAction} from  '../constants/pinentry'\n+\n+// TODO: have a root state that maps session id to pinentry popup\n+\n+export type PinentryState = {\n+  closed: boolean,\n+  sessionID: number,\n+  features: GUIEntryFeatures,\n+  prompt: string,\n+  windowTitle: string,\n+  cancelled: boolean,\n+  submitted: boolean,\n+  submitLabel: ?string,\n+  cancelLabel: ?string,\n+  retryLabel: ?string\n+}\n+\n+// Hack until flow allows disjoint unions by boolean types: https://github.com/facebook/flow/issues/577\n+export type RootPinentryState = {\n+  started: 1,\n+  pinentryStates: {\n+    [key: number]: PinentryState\n+  }\n+} | {\n+  started: 0\n+}\n+\n+type EnabledFeatures = {[key: string]: Feature}\n+\n+const intialState: RootPinentryState = {","path":"react-native/react/reducers/pinentry.js","position":35,"original_position":35,"commit_id":"0612b407f524c282196743f60acb57f3b3d1ac10","original_commit_id":"0612b407f524c282196743f60acb57f3b3d1ac10","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},"body":"initial","created_at":"2015-12-10T18:12:20Z","updated_at":"2015-12-10T18:12:20Z","html_url":"https://github.com/keybase/client/pull/1502#discussion_r47261974","pull_request_url":"https://api.github.com/repos/keybase/client/pulls/1502","_links":{"self":{"href":"https://api.github.com/repos/keybase/client/pulls/comments/47261974"},"html":{"href":"https://github.com/keybase/client/pull/1502#discussion_r47261974"},"pull_request":{"href":"https://api.github.com/repos/keybase/client/pulls/1502"}}},"pull_request":{"url":"https://api.github.com/repos/keybase/client/pulls/1502","id":53205518,"html_url":"https://github.com/keybase/client/pull/1502","diff_url":"https://github.com/keybase/client/pull/1502.diff","patch_url":"https://github.com/keybase/client/pull/1502.patch","issue_url":"https://api.github.com/repos/keybase/client/issues/1502","number":1502,"state":"open","locked":false,"title":"Refactor remote pinentry","user":{"login":"MarcoPolo","id":594035,"avatar_url":"https://avatars.githubusercontent.com/u/594035?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcoPolo","html_url":"https://github.com/MarcoPolo","followers_url":"https://api.github.com/users/MarcoPolo/followers","following_url":"https://api.github.com/users/MarcoPolo/following{/other_user}","gists_url":"https://api.github.com/users/MarcoPolo/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoPolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoPolo/subscriptions","organizations_url":"https://api.github.com/users/MarcoPolo/orgs","repos_url":"https://api.github.com/users/MarcoPolo/repos","events_url":"https://api.github.com/users/MarcoPolo/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoPolo/received_events","type":"User","site_admin":false},"body":"@keybase/react-hackers \r\n\r\nThis make Pinentry a remote component.\r\n\r\nSome subtleties: since we reply to the original notification, we have to keep around the response object until we have a value from the user. This is kinda lame, but it's how works now, so we have a map from sessionID to response object.\r\n\r\nA couple new things here:\r\n\r\nremote components can take functions as props (they always could, but now we're using it). We need it to reply to the correct response object.\r\n\r\nActions are somewhat strongly typed! So in the pinentry reducers, the actions are typed for Pinentry actions. So if you try to access something in the payload that doesn't exist it should error.","created_at":"2015-12-10T01:49:44Z","updated_at":"2015-12-10T18:12:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e551a1ffe74af16623ee38afc3c36f2afe810818","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/keybase/client/pulls/1502/commits","review_comments_url":"https://api.github.com/repos/keybase/client/pulls/1502/comments","review_comment_url":"https://api.github.com/repos/keybase/client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keybase/client/issues/1502/comments","statuses_url":"https://api.github.com/repos/keybase/client/statuses/0612b407f524c282196743f60acb57f3b3d1ac10","head":{"label":"keybase:refactor-remote-pinentry","ref":"refactor-remote-pinentry","sha":"0612b407f524c282196743f60acb57f3b3d1ac10","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":29099181,"name":"client","full_name":"keybase/client","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/client","description":"Keybase Go Library, Client, Service, OS X, iOS, Android, Electron","fork":false,"url":"https://api.github.com/repos/keybase/client","forks_url":"https://api.github.com/repos/keybase/client/forks","keys_url":"https://api.github.com/repos/keybase/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/client/teams","hooks_url":"https://api.github.com/repos/keybase/client/hooks","issue_events_url":"https://api.github.com/repos/keybase/client/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/client/events","assignees_url":"https://api.github.com/repos/keybase/client/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/client/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/client/tags","blobs_url":"https://api.github.com/repos/keybase/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/client/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/client/languages","stargazers_url":"https://api.github.com/repos/keybase/client/stargazers","contributors_url":"https://api.github.com/repos/keybase/client/contributors","subscribers_url":"https://api.github.com/repos/keybase/client/subscribers","subscription_url":"https://api.github.com/repos/keybase/client/subscription","commits_url":"https://api.github.com/repos/keybase/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/client/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/client/merges","archive_url":"https://api.github.com/repos/keybase/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/client/downloads","issues_url":"https://api.github.com/repos/keybase/client/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/client/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/client/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/client/labels{/name}","releases_url":"https://api.github.com/repos/keybase/client/releases{/id}","created_at":"2015-01-11T17:17:12Z","updated_at":"2015-12-09T22:32:59Z","pushed_at":"2015-12-10T18:04:17Z","git_url":"git://github.com/keybase/client.git","ssh_url":"git@github.com:keybase/client.git","clone_url":"https://github.com/keybase/client.git","svn_url":"https://github.com/keybase/client","homepage":"","size":117708,"stargazers_count":35,"watchers_count":35,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":24,"forks":3,"open_issues":24,"watchers":35,"default_branch":"master"}},"base":{"label":"keybase:master","ref":"master","sha":"b528edd492cf5c1e43ed6256f53e685c2306f90a","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":29099181,"name":"client","full_name":"keybase/client","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/client","description":"Keybase Go Library, Client, Service, OS X, iOS, Android, Electron","fork":false,"url":"https://api.github.com/repos/keybase/client","forks_url":"https://api.github.com/repos/keybase/client/forks","keys_url":"https://api.github.com/repos/keybase/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/client/teams","hooks_url":"https://api.github.com/repos/keybase/client/hooks","issue_events_url":"https://api.github.com/repos/keybase/client/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/client/events","assignees_url":"https://api.github.com/repos/keybase/client/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/client/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/client/tags","blobs_url":"https://api.github.com/repos/keybase/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/client/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/client/languages","stargazers_url":"https://api.github.com/repos/keybase/client/stargazers","contributors_url":"https://api.github.com/repos/keybase/client/contributors","subscribers_url":"https://api.github.com/repos/keybase/client/subscribers","subscription_url":"https://api.github.com/repos/keybase/client/subscription","commits_url":"https://api.github.com/repos/keybase/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/client/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/client/merges","archive_url":"https://api.github.com/repos/keybase/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/client/downloads","issues_url":"https://api.github.com/repos/keybase/client/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/client/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/client/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/client/labels{/name}","releases_url":"https://api.github.com/repos/keybase/client/releases{/id}","created_at":"2015-01-11T17:17:12Z","updated_at":"2015-12-09T22:32:59Z","pushed_at":"2015-12-10T18:04:17Z","git_url":"git://github.com/keybase/client.git","ssh_url":"git@github.com:keybase/client.git","clone_url":"https://github.com/keybase/client.git","svn_url":"https://github.com/keybase/client","homepage":"","size":117708,"stargazers_count":35,"watchers_count":35,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":24,"forks":3,"open_issues":24,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keybase/client/pulls/1502"},"html":{"href":"https://github.com/keybase/client/pull/1502"},"issue":{"href":"https://api.github.com/repos/keybase/client/issues/1502"},"comments":{"href":"https://api.github.com/repos/keybase/client/issues/1502/comments"},"review_comments":{"href":"https://api.github.com/repos/keybase/client/pulls/1502/comments"},"review_comment":{"href":"https://api.github.com/repos/keybase/client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keybase/client/pulls/1502/commits"},"statuses":{"href":"https://api.github.com/repos/keybase/client/statuses/0612b407f524c282196743f60acb57f3b3d1ac10"}}}}