{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/49493871","id":49493871,"diff_hunk":"@@ -10,6 +10,14 @@ const wpcom = require( 'lib/wp' ).undocumented();\n import { actionTypes } from './constants';\n import { fromApi, toApi } from './common';\n \n+const apiSuccess = (...args) => {\n+\tDispatcher.handleViewAction( {\n+\t\ttype: actionTypes.API_SUCCESS\n+\t} );\n+\n+\treturn args;","path":"client/lib/importer/actions.js","position":null,"original_position":9,"commit_id":"843e62c89f29830477508d8b80469cb53d3e39da","original_commit_id":"98e1c4cb1d599abaeddd4101bd59caea8dc1afd2","user":{"login":"dmsnell","id":5431237,"avatar_url":"https://avatars.githubusercontent.com/u/5431237?v=3","gravatar_id":"","url":"https://api.github.com/users/dmsnell","html_url":"https://github.com/dmsnell","followers_url":"https://api.github.com/users/dmsnell/followers","following_url":"https://api.github.com/users/dmsnell/following{/other_user}","gists_url":"https://api.github.com/users/dmsnell/gists{/gist_id}","starred_url":"https://api.github.com/users/dmsnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmsnell/subscriptions","organizations_url":"https://api.github.com/users/dmsnell/orgs","repos_url":"https://api.github.com/users/dmsnell/repos","events_url":"https://api.github.com/users/dmsnell/events{/privacy}","received_events_url":"https://api.github.com/users/dmsnell/received_events","type":"User","site_admin":false},"body":"Good point. The promise chain should only ever send a single argument down the list; I was trying to make sure I didn't mangle the arguments but ended up doing just that. I have changed this in 843e62c89f29830477508d8b80469cb53d3e39da to treat the input and output as a single variable.","created_at":"2016-01-12T18:34:31Z","updated_at":"2016-01-12T18:34:31Z","html_url":"https://github.com/Automattic/wp-calypso/pull/2298#discussion_r49493871","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/2298","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/49493871"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/2298#discussion_r49493871"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/2298"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/2298","id":55702436,"html_url":"https://github.com/Automattic/wp-calypso/pull/2298","diff_url":"https://github.com/Automattic/wp-calypso/pull/2298.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/2298.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/2298","number":2298,"state":"open","locked":false,"title":"Importer: Fix bug where importer wouldn't enable","user":{"login":"dmsnell","id":5431237,"avatar_url":"https://avatars.githubusercontent.com/u/5431237?v=3","gravatar_id":"","url":"https://api.github.com/users/dmsnell","html_url":"https://github.com/dmsnell","followers_url":"https://api.github.com/users/dmsnell/followers","following_url":"https://api.github.com/users/dmsnell/following{/other_user}","gists_url":"https://api.github.com/users/dmsnell/gists{/gist_id}","starred_url":"https://api.github.com/users/dmsnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmsnell/subscriptions","organizations_url":"https://api.github.com/users/dmsnell/orgs","repos_url":"https://api.github.com/users/dmsnell/repos","events_url":"https://api.github.com/users/dmsnell/events{/privacy}","received_events_url":"https://api.github.com/users/dmsnell/received_events","type":"User","site_admin":false},"body":"Previously, when visiting the import page for a site that had never had\r\nan attempted import already, the importer would never enable itself,\r\nremaining in the disabled state. The problem stemmed from the fact that\r\nthe API was sending a blank body, which caused a `TypeError` in the\r\n`fromApi` call, halting the process which would otherwise have hydrated\r\nthe store, that is, indicate that a successful API call had been made.\r\n\r\nNow the fetching logic maps over the response as a list so that null\r\nresponses like this won't break the importer.\r\n\r\nThis also includes a minor change to the store, adding a reset option to\r\nsupport testing, and also some tests to validate these behaviors.\r\n\r\n**Testing**\r\nTesting this requires trying to start an import on a site that has never had an import attempt (most sites). If it breaks, the importer won't ever leave the grayed-out disabled state. If it works, the importer will load and enable shortly after loading.\r\n\r\n@aduth could you review my tests here? I'm not a fan of using the Dispatcher but now isn't the right time for this feature to swap it out with Redux. Thus, testing is a, well, it's not fun :smile:.\r\n\r\ncc: @jordwest @roundhill @rodrigoi ","created_at":"2016-01-12T01:16:08Z","updated_at":"2016-01-12T18:34:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fb9d416f9189869f33789ec0e197f2b6f243a6d","assignee":null,"milestone":{"url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/49","html_url":"https://github.com/Automattic/wp-calypso/milestones/Import:%20First%20Release","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/49/labels","id":1478150,"number":49,"title":"Import: First Release","description":null,"creator":{"login":"designsimply","id":1119271,"avatar_url":"https://avatars.githubusercontent.com/u/1119271?v=3","gravatar_id":"","url":"https://api.github.com/users/designsimply","html_url":"https://github.com/designsimply","followers_url":"https://api.github.com/users/designsimply/followers","following_url":"https://api.github.com/users/designsimply/following{/other_user}","gists_url":"https://api.github.com/users/designsimply/gists{/gist_id}","starred_url":"https://api.github.com/users/designsimply/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/designsimply/subscriptions","organizations_url":"https://api.github.com/users/designsimply/orgs","repos_url":"https://api.github.com/users/designsimply/repos","events_url":"https://api.github.com/users/designsimply/events{/privacy}","received_events_url":"https://api.github.com/users/designsimply/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":3,"state":"open","created_at":"2015-12-30T14:15:59Z","updated_at":"2016-01-12T01:16:08Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/2298/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/2298/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/2298/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/843e62c89f29830477508d8b80469cb53d3e39da","head":{"label":"Automattic:fix/importer/fails-if-uninitialized","ref":"fix/importer/fails-if-uninitialized","sha":"843e62c89f29830477508d8b80469cb53d3e39da","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-01-12T18:03:02Z","pushed_at":"2016-01-12T18:33:30Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":14162,"stargazers_count":6559,"watchers_count":6559,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":721,"mirror_url":null,"open_issues_count":1095,"forks":721,"open_issues":1095,"watchers":6559,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"0c62a644ce188d6f0a0306ba4c2c8b16bbee79cb","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-01-12T18:03:02Z","pushed_at":"2016-01-12T18:33:30Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":14162,"stargazers_count":6559,"watchers_count":6559,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":721,"mirror_url":null,"open_issues_count":1095,"forks":721,"open_issues":1095,"watchers":6559,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/2298"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/2298"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/2298"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/2298/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/2298/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/2298/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/843e62c89f29830477508d8b80469cb53d3e39da"}}}}