{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/104662740","pull_request_review_id":25508220,"id":104662740,"diff_hunk":"@@ -282,6 +281,20 @@ export function edits( state = {}, action ) {\n \t\t\t\t[ action.siteId ]: omit( state[ action.siteId ], action.postId || '' )\n \t\t\t} );\n \n+\t\tcase POST_SAVE_SUCCESS:\n+\t\t\tif ( ! state.hasOwnProperty( action.siteId ) || ! action.savedPost || action.postId ) {\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\tconst { siteId, savedPost } = action;","path":"client/state/posts/reducer.js","position":25,"original_position":25,"commit_id":"940d4797b7e87a13c645ab6295a0b5cca90774c5","original_commit_id":"940d4797b7e87a13c645ab6295a0b5cca90774c5","user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars2.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"body":"Minor, not worth another round of reviews: Could move destructuring above the condition to make the condition slightly shorter:\r\n\r\n```js\r\nconst { siteId, savedPost, postId } = action;\r\nif ( ! state.hasOwnProperty( siteId ) || ! savedPost || postId ) {\r\n```","created_at":"2017-03-07T13:17:50Z","updated_at":"2017-03-07T13:26:26Z","html_url":"https://github.com/Automattic/wp-calypso/pull/11729#discussion_r104662740","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11729","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/104662740"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/11729#discussion_r104662740"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11729"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11729","id":108889835,"html_url":"https://github.com/Automattic/wp-calypso/pull/11729","diff_url":"https://github.com/Automattic/wp-calypso/pull/11729.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/11729.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/11729","number":11729,"state":"open","locked":false,"title":"Editor: Fix over-riding of local title edits on auto-save.","user":{"login":"timmyc","id":22080,"avatar_url":"https://avatars3.githubusercontent.com/u/22080?v=3","gravatar_id":"","url":"https://api.github.com/users/timmyc","html_url":"https://github.com/timmyc","followers_url":"https://api.github.com/users/timmyc/followers","following_url":"https://api.github.com/users/timmyc/following{/other_user}","gists_url":"https://api.github.com/users/timmyc/gists{/gist_id}","starred_url":"https://api.github.com/users/timmyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timmyc/subscriptions","organizations_url":"https://api.github.com/users/timmyc/orgs","repos_url":"https://api.github.com/users/timmyc/repos","events_url":"https://api.github.com/users/timmyc/events{/privacy}","received_events_url":"https://api.github.com/users/timmyc/received_events","type":"User","site_admin":false},"body":"This branch fixes #11567 which is causing local edits of the title field to be lost when the changes are made while an auto-save is in flight.\r\n\r\nThere is a video of the bug in #11567 - but to see the bug in action, add some content to a post ( draft ) you are editing, then focus on the title field.  Watch the ground control area, and as soon as an auto save fires, start changing the title, and once the API returns, your local title changes will disappear 💥 \r\n\r\nI traced the issue back to `onSaveSuccess` in `<PostEditor />` which was calling `savePostSuccess` which clears out any local edits in the state tree.  `onSaveSuccess` also calls `receivePost` which iterates over the local edits, and compares it against the saved post from the API, and only deletes edits that match - so it _seems_ like the call to `recievePost` should be enough here ( though /cc @aduth for your thoughts ).","created_at":"2017-03-03T01:33:58Z","updated_at":"2017-03-07T13:26:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"beecd6e879ec229b7039d2777570286c80c02ab7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11729/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11729/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/11729/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/940d4797b7e87a13c645ab6295a0b5cca90774c5","head":{"label":"Automattic:fix/editor/11567","ref":"fix/editor/11567","sha":"940d4797b7e87a13c645ab6295a0b5cca90774c5","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.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://avatars2.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}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2017-03-07T02:34:03Z","pushed_at":"2017-03-07T13:07:14Z","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":46046,"stargazers_count":8534,"watchers_count":8534,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1086,"mirror_url":null,"open_issues_count":1719,"forks":1086,"open_issues":1719,"watchers":8534,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"cc0a0d100ad0cfdb447ea32f68a594ec5a8c228e","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.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://avatars2.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}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2017-03-07T02:34:03Z","pushed_at":"2017-03-07T13:07:14Z","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":46046,"stargazers_count":8534,"watchers_count":8534,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1086,"mirror_url":null,"open_issues_count":1719,"forks":1086,"open_issues":1719,"watchers":8534,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11729"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/11729"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/11729"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/11729/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11729/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/11729/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/940d4797b7e87a13c645ab6295a0b5cca90774c5"}}}}
{"actor":{"display_login":"aduth"}}