{"action":"created","comment":{"url":"https://api.github.com/repos/automerge/automerge/pulls/comments/137567783","pull_request_review_id":61253691,"id":137567783,"diff_hunk":"@@ -0,0 +1,112 @@\n+const { Map, fromJS } = require('immutable')\n+const OpSet = require('./op_set')\n+\n+// Returns true if all components of clock1 are less than or equal to those of clock2.\n+// Returns false if the clocks are incomparable or if clock1 is greater than clock2.","path":"src/connection.js","position":5,"original_position":5,"commit_id":"7012eefbe3e78e38df9af3f27fd9afa37671f546","original_commit_id":"7012eefbe3e78e38df9af3f27fd9afa37671f546","user":{"login":"pvh","id":2880,"avatar_url":"https://avatars2.githubusercontent.com/u/2880?v=4","gravatar_id":"","url":"https://api.github.com/users/pvh","html_url":"https://github.com/pvh","followers_url":"https://api.github.com/users/pvh/followers","following_url":"https://api.github.com/users/pvh/following{/other_user}","gists_url":"https://api.github.com/users/pvh/gists{/gist_id}","starred_url":"https://api.github.com/users/pvh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvh/subscriptions","organizations_url":"https://api.github.com/users/pvh/orgs","repos_url":"https://api.github.com/users/pvh/repos","events_url":"https://api.github.com/users/pvh/events{/privacy}","received_events_url":"https://api.github.com/users/pvh/received_events","type":"User","site_admin":false},"body":"When would a clock be incomparable? Reading the code I don't see an obvious case when that would be.","created_at":"2017-09-07T15:12:08Z","updated_at":"2017-09-07T15:39:56Z","html_url":"https://github.com/automerge/automerge/pull/36#discussion_r137567783","pull_request_url":"https://api.github.com/repos/automerge/automerge/pulls/36","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/automerge/automerge/pulls/comments/137567783"},"html":{"href":"https://github.com/automerge/automerge/pull/36#discussion_r137567783"},"pull_request":{"href":"https://api.github.com/repos/automerge/automerge/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/automerge/automerge/pulls/36","id":136551485,"html_url":"https://github.com/automerge/automerge/pull/36","diff_url":"https://github.com/automerge/automerge/pull/36.diff","patch_url":"https://github.com/automerge/automerge/pull/36.patch","issue_url":"https://api.github.com/repos/automerge/automerge/issues/36","number":36,"state":"open","locked":false,"title":"Connection abstraction to manage peer communication","user":{"login":"ept","id":27544,"avatar_url":"https://avatars0.githubusercontent.com/u/27544?v=4","gravatar_id":"","url":"https://api.github.com/users/ept","html_url":"https://github.com/ept","followers_url":"https://api.github.com/users/ept/followers","following_url":"https://api.github.com/users/ept/following{/other_user}","gists_url":"https://api.github.com/users/ept/gists{/gist_id}","starred_url":"https://api.github.com/users/ept/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ept/subscriptions","organizations_url":"https://api.github.com/users/ept/orgs","repos_url":"https://api.github.com/users/ept/repos","events_url":"https://api.github.com/users/ept/events{/privacy}","received_events_url":"https://api.github.com/users/ept/received_events","type":"User","site_admin":false},"body":"This PR removes the getVClock/getDeltasAfter/applyDeltas API for network communication, and introduces a new Connection API instead. It remains abstract (not tied to any particular network protocol), but it incorporates most of the features [MPL's DeltaRouter](https://github.com/automerge/mpl/blob/f31c343787584baf73aec1c234f9d2db54baf2cd/src/mpl/network/delta-router.js). Hopefully this will let us move complexity out of MPL.\r\n\r\nAutomerge's new Connection class includes the network protocol essentials that are needed regardless of the physical type of network. The only thing it assumes is that communication between nodes goes via one-to-one (unicast) communication. It supports any network topology, including client/server or peer-to-peer (partially or fully connected graph). It assumes that network connections are slightly stateful (at the level of, say, a TCP connection), but it doesn't assume any long-term state about peers. This connection abstraction is the first step towards using hash chaining instead of vector clocks for tracking causal dependencies (#28).\r\n\r\nThis PR also explores how to handle multiple documents. It introduces a simple DocSet collection that maps some kind of docId to Automerge documents. I'm not sure yet how this may relate to the *channel* concept discussed in #31. More thinking to be done here.\r\n\r\n@pvh if you have time at some point, could you take a look and let me know if you think this is going in the right direction? I'm about to go on holiday for a week (back on Aug 28), and when I get back I can try porting MPL to this Connection API to see how it goes. Also, the tests are currently very verbose; I have in mind a little DSL that would tidy them up, but I haven't yet finished it.","created_at":"2017-08-18T19:44:48Z","updated_at":"2017-09-07T15:39:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f15639caf0f81ee5b890b7ea033a344fcd668934","assignee":{"login":"ept","id":27544,"avatar_url":"https://avatars0.githubusercontent.com/u/27544?v=4","gravatar_id":"","url":"https://api.github.com/users/ept","html_url":"https://github.com/ept","followers_url":"https://api.github.com/users/ept/followers","following_url":"https://api.github.com/users/ept/following{/other_user}","gists_url":"https://api.github.com/users/ept/gists{/gist_id}","starred_url":"https://api.github.com/users/ept/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ept/subscriptions","organizations_url":"https://api.github.com/users/ept/orgs","repos_url":"https://api.github.com/users/ept/repos","events_url":"https://api.github.com/users/ept/events{/privacy}","received_events_url":"https://api.github.com/users/ept/received_events","type":"User","site_admin":false},"assignees":[{"login":"ept","id":27544,"avatar_url":"https://avatars0.githubusercontent.com/u/27544?v=4","gravatar_id":"","url":"https://api.github.com/users/ept","html_url":"https://github.com/ept","followers_url":"https://api.github.com/users/ept/followers","following_url":"https://api.github.com/users/ept/following{/other_user}","gists_url":"https://api.github.com/users/ept/gists{/gist_id}","starred_url":"https://api.github.com/users/ept/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ept/subscriptions","organizations_url":"https://api.github.com/users/ept/orgs","repos_url":"https://api.github.com/users/ept/repos","events_url":"https://api.github.com/users/ept/events{/privacy}","received_events_url":"https://api.github.com/users/ept/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/automerge/automerge/pulls/36/commits","review_comments_url":"https://api.github.com/repos/automerge/automerge/pulls/36/comments","review_comment_url":"https://api.github.com/repos/automerge/automerge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/automerge/automerge/issues/36/comments","statuses_url":"https://api.github.com/repos/automerge/automerge/statuses/7012eefbe3e78e38df9af3f27fd9afa37671f546","head":{"label":"automerge:connection","ref":"connection","sha":"7012eefbe3e78e38df9af3f27fd9afa37671f546","user":{"login":"automerge","id":29780209,"avatar_url":"https://avatars3.githubusercontent.com/u/29780209?v=4","gravatar_id":"","url":"https://api.github.com/users/automerge","html_url":"https://github.com/automerge","followers_url":"https://api.github.com/users/automerge/followers","following_url":"https://api.github.com/users/automerge/following{/other_user}","gists_url":"https://api.github.com/users/automerge/gists{/gist_id}","starred_url":"https://api.github.com/users/automerge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/automerge/subscriptions","organizations_url":"https://api.github.com/users/automerge/orgs","repos_url":"https://api.github.com/users/automerge/repos","events_url":"https://api.github.com/users/automerge/events{/privacy}","received_events_url":"https://api.github.com/users/automerge/received_events","type":"Organization","site_admin":false},"repo":{"id":88760614,"name":"automerge","full_name":"automerge/automerge","owner":{"login":"automerge","id":29780209,"avatar_url":"https://avatars3.githubusercontent.com/u/29780209?v=4","gravatar_id":"","url":"https://api.github.com/users/automerge","html_url":"https://github.com/automerge","followers_url":"https://api.github.com/users/automerge/followers","following_url":"https://api.github.com/users/automerge/following{/other_user}","gists_url":"https://api.github.com/users/automerge/gists{/gist_id}","starred_url":"https://api.github.com/users/automerge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/automerge/subscriptions","organizations_url":"https://api.github.com/users/automerge/orgs","repos_url":"https://api.github.com/users/automerge/repos","events_url":"https://api.github.com/users/automerge/events{/privacy}","received_events_url":"https://api.github.com/users/automerge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/automerge/automerge","description":"A JSON-like data structure that can be modified concurrently by different users, and merged again automatically.","fork":false,"url":"https://api.github.com/repos/automerge/automerge","forks_url":"https://api.github.com/repos/automerge/automerge/forks","keys_url":"https://api.github.com/repos/automerge/automerge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/automerge/automerge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/automerge/automerge/teams","hooks_url":"https://api.github.com/repos/automerge/automerge/hooks","issue_events_url":"https://api.github.com/repos/automerge/automerge/issues/events{/number}","events_url":"https://api.github.com/repos/automerge/automerge/events","assignees_url":"https://api.github.com/repos/automerge/automerge/assignees{/user}","branches_url":"https://api.github.com/repos/automerge/automerge/branches{/branch}","tags_url":"https://api.github.com/repos/automerge/automerge/tags","blobs_url":"https://api.github.com/repos/automerge/automerge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/automerge/automerge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/automerge/automerge/git/refs{/sha}","trees_url":"https://api.github.com/repos/automerge/automerge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/automerge/automerge/statuses/{sha}","languages_url":"https://api.github.com/repos/automerge/automerge/languages","stargazers_url":"https://api.github.com/repos/automerge/automerge/stargazers","contributors_url":"https://api.github.com/repos/automerge/automerge/contributors","subscribers_url":"https://api.github.com/repos/automerge/automerge/subscribers","subscription_url":"https://api.github.com/repos/automerge/automerge/subscription","commits_url":"https://api.github.com/repos/automerge/automerge/commits{/sha}","git_commits_url":"https://api.github.com/repos/automerge/automerge/git/commits{/sha}","comments_url":"https://api.github.com/repos/automerge/automerge/comments{/number}","issue_comment_url":"https://api.github.com/repos/automerge/automerge/issues/comments{/number}","contents_url":"https://api.github.com/repos/automerge/automerge/contents/{+path}","compare_url":"https://api.github.com/repos/automerge/automerge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/automerge/automerge/merges","archive_url":"https://api.github.com/repos/automerge/automerge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/automerge/automerge/downloads","issues_url":"https://api.github.com/repos/automerge/automerge/issues{/number}","pulls_url":"https://api.github.com/repos/automerge/automerge/pulls{/number}","milestones_url":"https://api.github.com/repos/automerge/automerge/milestones{/number}","notifications_url":"https://api.github.com/repos/automerge/automerge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/automerge/automerge/labels{/name}","releases_url":"https://api.github.com/repos/automerge/automerge/releases{/id}","deployments_url":"https://api.github.com/repos/automerge/automerge/deployments","created_at":"2017-04-19T15:25:24Z","updated_at":"2017-08-21T15:57:39Z","pushed_at":"2017-09-04T15:20:41Z","git_url":"git://github.com/automerge/automerge.git","ssh_url":"git@github.com:automerge/automerge.git","clone_url":"https://github.com/automerge/automerge.git","svn_url":"https://github.com/automerge/automerge","homepage":"","size":216,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":10,"forks":4,"open_issues":10,"watchers":32,"default_branch":"master"}},"base":{"label":"automerge:master","ref":"master","sha":"e6af34850bb9451ef6c8d3b1ad486378f45e857d","user":{"login":"automerge","id":29780209,"avatar_url":"https://avatars3.githubusercontent.com/u/29780209?v=4","gravatar_id":"","url":"https://api.github.com/users/automerge","html_url":"https://github.com/automerge","followers_url":"https://api.github.com/users/automerge/followers","following_url":"https://api.github.com/users/automerge/following{/other_user}","gists_url":"https://api.github.com/users/automerge/gists{/gist_id}","starred_url":"https://api.github.com/users/automerge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/automerge/subscriptions","organizations_url":"https://api.github.com/users/automerge/orgs","repos_url":"https://api.github.com/users/automerge/repos","events_url":"https://api.github.com/users/automerge/events{/privacy}","received_events_url":"https://api.github.com/users/automerge/received_events","type":"Organization","site_admin":false},"repo":{"id":88760614,"name":"automerge","full_name":"automerge/automerge","owner":{"login":"automerge","id":29780209,"avatar_url":"https://avatars3.githubusercontent.com/u/29780209?v=4","gravatar_id":"","url":"https://api.github.com/users/automerge","html_url":"https://github.com/automerge","followers_url":"https://api.github.com/users/automerge/followers","following_url":"https://api.github.com/users/automerge/following{/other_user}","gists_url":"https://api.github.com/users/automerge/gists{/gist_id}","starred_url":"https://api.github.com/users/automerge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/automerge/subscriptions","organizations_url":"https://api.github.com/users/automerge/orgs","repos_url":"https://api.github.com/users/automerge/repos","events_url":"https://api.github.com/users/automerge/events{/privacy}","received_events_url":"https://api.github.com/users/automerge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/automerge/automerge","description":"A JSON-like data structure that can be modified concurrently by different users, and merged again automatically.","fork":false,"url":"https://api.github.com/repos/automerge/automerge","forks_url":"https://api.github.com/repos/automerge/automerge/forks","keys_url":"https://api.github.com/repos/automerge/automerge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/automerge/automerge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/automerge/automerge/teams","hooks_url":"https://api.github.com/repos/automerge/automerge/hooks","issue_events_url":"https://api.github.com/repos/automerge/automerge/issues/events{/number}","events_url":"https://api.github.com/repos/automerge/automerge/events","assignees_url":"https://api.github.com/repos/automerge/automerge/assignees{/user}","branches_url":"https://api.github.com/repos/automerge/automerge/branches{/branch}","tags_url":"https://api.github.com/repos/automerge/automerge/tags","blobs_url":"https://api.github.com/repos/automerge/automerge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/automerge/automerge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/automerge/automerge/git/refs{/sha}","trees_url":"https://api.github.com/repos/automerge/automerge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/automerge/automerge/statuses/{sha}","languages_url":"https://api.github.com/repos/automerge/automerge/languages","stargazers_url":"https://api.github.com/repos/automerge/automerge/stargazers","contributors_url":"https://api.github.com/repos/automerge/automerge/contributors","subscribers_url":"https://api.github.com/repos/automerge/automerge/subscribers","subscription_url":"https://api.github.com/repos/automerge/automerge/subscription","commits_url":"https://api.github.com/repos/automerge/automerge/commits{/sha}","git_commits_url":"https://api.github.com/repos/automerge/automerge/git/commits{/sha}","comments_url":"https://api.github.com/repos/automerge/automerge/comments{/number}","issue_comment_url":"https://api.github.com/repos/automerge/automerge/issues/comments{/number}","contents_url":"https://api.github.com/repos/automerge/automerge/contents/{+path}","compare_url":"https://api.github.com/repos/automerge/automerge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/automerge/automerge/merges","archive_url":"https://api.github.com/repos/automerge/automerge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/automerge/automerge/downloads","issues_url":"https://api.github.com/repos/automerge/automerge/issues{/number}","pulls_url":"https://api.github.com/repos/automerge/automerge/pulls{/number}","milestones_url":"https://api.github.com/repos/automerge/automerge/milestones{/number}","notifications_url":"https://api.github.com/repos/automerge/automerge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/automerge/automerge/labels{/name}","releases_url":"https://api.github.com/repos/automerge/automerge/releases{/id}","deployments_url":"https://api.github.com/repos/automerge/automerge/deployments","created_at":"2017-04-19T15:25:24Z","updated_at":"2017-08-21T15:57:39Z","pushed_at":"2017-09-04T15:20:41Z","git_url":"git://github.com/automerge/automerge.git","ssh_url":"git@github.com:automerge/automerge.git","clone_url":"https://github.com/automerge/automerge.git","svn_url":"https://github.com/automerge/automerge","homepage":"","size":216,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":10,"forks":4,"open_issues":10,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/automerge/automerge/pulls/36"},"html":{"href":"https://github.com/automerge/automerge/pull/36"},"issue":{"href":"https://api.github.com/repos/automerge/automerge/issues/36"},"comments":{"href":"https://api.github.com/repos/automerge/automerge/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/automerge/automerge/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/automerge/automerge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/automerge/automerge/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/automerge/automerge/statuses/7012eefbe3e78e38df9af3f27fd9afa37671f546"}},"author_association":"OWNER"}}
{"actor":{"display_login":"pvh"}}