{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/179499361","pull_request_review_id":109754879,"id":179499361,"diff_hunk":"@@ -29,8 +29,14 @@ export default class ActivityQueryManager extends QueryManager {\n \t * @return {Number}       0 if equal, less than 0 if itemA is first,\n \t *                        greater than 0 if itemB is first.\n \t */\n-\tstatic compare( query, { activityTs: tsA }, { activityTs: tsB } ) {\n-\t\treturn Date.parse( tsB ) - Date.parse( tsA );\n+\tstatic compare( query, a, b ) {\n+\t\tif ( a.rewindId && b.rewindId ) {\n+\t\t\treturn b.rewindId - a.rewindId;","path":"client/lib/query-manager/activity/index.js","position":8,"original_position":8,"commit_id":"2eb51227f04544c4930481496308f62cb92808b4","original_commit_id":"2eb51227f04544c4930481496308f62cb92808b4","user":{"login":"sirreal","id":841763,"avatar_url":"https://avatars2.githubusercontent.com/u/841763?v=4","gravatar_id":"","url":"https://api.github.com/users/sirreal","html_url":"https://github.com/sirreal","followers_url":"https://api.github.com/users/sirreal/followers","following_url":"https://api.github.com/users/sirreal/following{/other_user}","gists_url":"https://api.github.com/users/sirreal/gists{/gist_id}","starred_url":"https://api.github.com/users/sirreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirreal/subscriptions","organizations_url":"https://api.github.com/users/sirreal/orgs","repos_url":"https://api.github.com/users/sirreal/repos","events_url":"https://api.github.com/users/sirreal/events{/privacy}","received_events_url":"https://api.github.com/users/sirreal/received_events","type":"User","site_admin":false},"body":"Should be good:\r\n\r\nhttps://github.com/Automattic/wp-calypso/blob/37520163ca8373fbcb35fb0a0e3d68f720eb4a48/client/state/data-layer/wpcom/sites/activity/from-api.js#L64\r\n\r\nThis required by the fromApi schema, so I'd expect this to be present:\r\n\r\nhttps://github.com/Automattic/wp-calypso/blob/8f1319660193905d62435d42805c56d84a5543de/client/state/data-layer/wpcom/sites/activity/schema.json#L37","created_at":"2018-04-05T15:16:28Z","updated_at":"2018-04-05T15:18:24Z","html_url":"https://github.com/Automattic/wp-calypso/pull/23931#discussion_r179499361","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23931","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/179499361"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/23931#discussion_r179499361"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23931"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23931","id":179688933,"html_url":"https://github.com/Automattic/wp-calypso/pull/23931","diff_url":"https://github.com/Automattic/wp-calypso/pull/23931.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/23931.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/23931","number":23931,"state":"open","locked":false,"title":"Activity Log: Sort events using `rewindId`","user":{"login":"dmsnell","id":5431237,"avatar_url":"https://avatars3.githubusercontent.com/u/5431237?v=4","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 we have been sorting Activity Log events by the `activityTs`\r\nvalue which comes from the `published` attribute in the events.\r\n\r\nProblematic is that this timestamp is a truncated version of the\r\ntimestamp and when events happen in short succession then we can get\r\nevents out of order.\r\n\r\nBy changing to the `rewindId` we move to a canonical value that should\r\npreserve ordering to the best ability of the remote system where the\r\nvalue was first generated.\r\n\r\n---\r\n\r\n@eliorivero I don't think this will address any of the recent sequencing issues\r\nwe've discussed though it may touch some long-standing issues.","created_at":"2018-04-05T14:11:55Z","updated_at":"2018-04-05T15:18:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5ad64978483a32ac3d188f53228396a4d3d936f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"keoshi","id":390760,"avatar_url":"https://avatars0.githubusercontent.com/u/390760?v=4","gravatar_id":"","url":"https://api.github.com/users/keoshi","html_url":"https://github.com/keoshi","followers_url":"https://api.github.com/users/keoshi/followers","following_url":"https://api.github.com/users/keoshi/following{/other_user}","gists_url":"https://api.github.com/users/keoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/keoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keoshi/subscriptions","organizations_url":"https://api.github.com/users/keoshi/orgs","repos_url":"https://api.github.com/users/keoshi/repos","events_url":"https://api.github.com/users/keoshi/events{/privacy}","received_events_url":"https://api.github.com/users/keoshi/received_events","type":"User","site_admin":false},{"login":"eliorivero","id":1041600,"avatar_url":"https://avatars3.githubusercontent.com/u/1041600?v=4","gravatar_id":"","url":"https://api.github.com/users/eliorivero","html_url":"https://github.com/eliorivero","followers_url":"https://api.github.com/users/eliorivero/followers","following_url":"https://api.github.com/users/eliorivero/following{/other_user}","gists_url":"https://api.github.com/users/eliorivero/gists{/gist_id}","starred_url":"https://api.github.com/users/eliorivero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliorivero/subscriptions","organizations_url":"https://api.github.com/users/eliorivero/orgs","repos_url":"https://api.github.com/users/eliorivero/repos","events_url":"https://api.github.com/users/eliorivero/events{/privacy}","received_events_url":"https://api.github.com/users/eliorivero/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":611874987,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Activity/Rewind","name":"Activity/Rewind","color":"006b75","default":false},{"id":285010018,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23931/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23931/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/23931/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/2eb51227f04544c4930481496308f62cb92808b4","head":{"label":"Automattic:activity-log/sort-by-rewind-id","ref":"activity-log/sort-by-rewind-id","sha":"2eb51227f04544c4930481496308f62cb92808b4","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","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://avatars1.githubusercontent.com/u/887802?v=4","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 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":"2018-04-05T15:02:49Z","pushed_at":"2018-04-05T15:16:08Z","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":85851,"stargazers_count":9852,"watchers_count":9852,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1382,"mirror_url":null,"archived":false,"open_issues_count":1518,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1382,"open_issues":1518,"watchers":9852,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"37520163ca8373fbcb35fb0a0e3d68f720eb4a48","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","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://avatars1.githubusercontent.com/u/887802?v=4","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 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":"2018-04-05T15:02:49Z","pushed_at":"2018-04-05T15:16:08Z","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":85851,"stargazers_count":9852,"watchers_count":9852,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1382,"mirror_url":null,"archived":false,"open_issues_count":1518,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1382,"open_issues":1518,"watchers":9852,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23931"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/23931"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/23931"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/23931/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23931/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/23931/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/2eb51227f04544c4930481496308f62cb92808b4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sirreal"}}