{"action":"created","comment":{"url":"https://api.github.com/repos/loomio/loomio/pulls/comments/36378224","id":36378224,"diff_hunk":"@@ -1,7 +1,8 @@\n class Events::NewDiscussion < Event\n   def self.publish!(discussion)\n     event = create!(kind: 'new_discussion',\n-                    eventable: discussion)\n+                    eventable: discussion,\n+                    sequence_id: 0)","path":"app/models/events/new_discussion.rb","position":6,"original_position":6,"commit_id":"172f389787bdb4c927e011aa5c9eac86131d21fe","original_commit_id":"172f389787bdb4c927e011aa5c9eac86131d21fe","user":{"login":"gdpelican","id":750477,"avatar_url":"https://avatars.githubusercontent.com/u/750477?v=3","gravatar_id":"","url":"https://api.github.com/users/gdpelican","html_url":"https://github.com/gdpelican","followers_url":"https://api.github.com/users/gdpelican/followers","following_url":"https://api.github.com/users/gdpelican/following{/other_user}","gists_url":"https://api.github.com/users/gdpelican/gists{/gist_id}","starred_url":"https://api.github.com/users/gdpelican/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdpelican/subscriptions","organizations_url":"https://api.github.com/users/gdpelican/orgs","repos_url":"https://api.github.com/users/gdpelican/repos","events_url":"https://api.github.com/users/gdpelican/events{/privacy}","received_events_url":"https://api.github.com/users/gdpelican/received_events","type":"User","site_admin":false},"body":"@robguthrie Can you think of anything dangerous about doing this?\r\n\r\nThe current bug is as follows:\r\n\r\nWe have an auto-sequencer set up on event models which are in a 'discussion_id' channel.\r\nWe don't add a sequence id if event.discussion is nil\r\nThe 'discussion_id' of a 'new_discussion' event is nil, because the discussion id is stored in `eventable_id`\r\n\r\nSo, the 'new_discussion' event is sequenced, and it's sequenced in the 'discussion_id == nil' channel. Meaning it's equal to the number of discussions created since the sequencer was put in (~40k at this point)\r\n\r\nThe logic on the client side says something like 'if the minimum loaded event for this discussion has sequence id > discussion.firstSequenceId, show loadPreviousActivity'. This returns true if there is one event, and that event has sequence id ~40,000.","created_at":"2015-08-06T03:15:53Z","updated_at":"2015-08-06T03:15:53Z","html_url":"https://github.com/loomio/loomio/pull/2378#discussion_r36378224","pull_request_url":"https://api.github.com/repos/loomio/loomio/pulls/2378","_links":{"self":{"href":"https://api.github.com/repos/loomio/loomio/pulls/comments/36378224"},"html":{"href":"https://github.com/loomio/loomio/pull/2378#discussion_r36378224"},"pull_request":{"href":"https://api.github.com/repos/loomio/loomio/pulls/2378"}}},"pull_request":{"url":"https://api.github.com/repos/loomio/loomio/pulls/2378","id":41748187,"html_url":"https://github.com/loomio/loomio/pull/2378","diff_url":"https://github.com/loomio/loomio/pull/2378.diff","patch_url":"https://github.com/loomio/loomio/pull/2378.patch","issue_url":"https://api.github.com/repos/loomio/loomio/issues/2378","number":2378,"state":"open","locked":false,"title":"Fix load earlier activity bug","user":{"login":"HSalmon","id":2882097,"avatar_url":"https://avatars.githubusercontent.com/u/2882097?v=3","gravatar_id":"","url":"https://api.github.com/users/HSalmon","html_url":"https://github.com/HSalmon","followers_url":"https://api.github.com/users/HSalmon/followers","following_url":"https://api.github.com/users/HSalmon/following{/other_user}","gists_url":"https://api.github.com/users/HSalmon/gists{/gist_id}","starred_url":"https://api.github.com/users/HSalmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HSalmon/subscriptions","organizations_url":"https://api.github.com/users/HSalmon/orgs","repos_url":"https://api.github.com/users/HSalmon/repos","events_url":"https://api.github.com/users/HSalmon/events{/privacy}","received_events_url":"https://api.github.com/users/HSalmon/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-06T03:10:31Z","updated_at":"2015-08-06T03:15:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b318e5a98c648efe73340bd759d3b53d8e6bf794","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/loomio/loomio/pulls/2378/commits","review_comments_url":"https://api.github.com/repos/loomio/loomio/pulls/2378/comments","review_comment_url":"https://api.github.com/repos/loomio/loomio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/loomio/loomio/issues/2378/comments","statuses_url":"https://api.github.com/repos/loomio/loomio/statuses/172f389787bdb4c927e011aa5c9eac86131d21fe","head":{"label":"loomio:fix-load-earlier-activity","ref":"fix-load-earlier-activity","sha":"172f389787bdb4c927e011aa5c9eac86131d21fe","user":{"login":"loomio","id":1896739,"avatar_url":"https://avatars.githubusercontent.com/u/1896739?v=3","gravatar_id":"","url":"https://api.github.com/users/loomio","html_url":"https://github.com/loomio","followers_url":"https://api.github.com/users/loomio/followers","following_url":"https://api.github.com/users/loomio/following{/other_user}","gists_url":"https://api.github.com/users/loomio/gists{/gist_id}","starred_url":"https://api.github.com/users/loomio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loomio/subscriptions","organizations_url":"https://api.github.com/users/loomio/orgs","repos_url":"https://api.github.com/users/loomio/repos","events_url":"https://api.github.com/users/loomio/events{/privacy}","received_events_url":"https://api.github.com/users/loomio/received_events","type":"Organization","site_admin":false},"repo":{"id":2731301,"name":"loomio","full_name":"loomio/loomio","owner":{"login":"loomio","id":1896739,"avatar_url":"https://avatars.githubusercontent.com/u/1896739?v=3","gravatar_id":"","url":"https://api.github.com/users/loomio","html_url":"https://github.com/loomio","followers_url":"https://api.github.com/users/loomio/followers","following_url":"https://api.github.com/users/loomio/following{/other_user}","gists_url":"https://api.github.com/users/loomio/gists{/gist_id}","starred_url":"https://api.github.com/users/loomio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loomio/subscriptions","organizations_url":"https://api.github.com/users/loomio/orgs","repos_url":"https://api.github.com/users/loomio/repos","events_url":"https://api.github.com/users/loomio/events{/privacy}","received_events_url":"https://api.github.com/users/loomio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/loomio/loomio","description":"Loomio is an open-source web application that helps groups make better decisions together.","fork":false,"url":"https://api.github.com/repos/loomio/loomio","forks_url":"https://api.github.com/repos/loomio/loomio/forks","keys_url":"https://api.github.com/repos/loomio/loomio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/loomio/loomio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/loomio/loomio/teams","hooks_url":"https://api.github.com/repos/loomio/loomio/hooks","issue_events_url":"https://api.github.com/repos/loomio/loomio/issues/events{/number}","events_url":"https://api.github.com/repos/loomio/loomio/events","assignees_url":"https://api.github.com/repos/loomio/loomio/assignees{/user}","branches_url":"https://api.github.com/repos/loomio/loomio/branches{/branch}","tags_url":"https://api.github.com/repos/loomio/loomio/tags","blobs_url":"https://api.github.com/repos/loomio/loomio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/loomio/loomio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/loomio/loomio/git/refs{/sha}","trees_url":"https://api.github.com/repos/loomio/loomio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/loomio/loomio/statuses/{sha}","languages_url":"https://api.github.com/repos/loomio/loomio/languages","stargazers_url":"https://api.github.com/repos/loomio/loomio/stargazers","contributors_url":"https://api.github.com/repos/loomio/loomio/contributors","subscribers_url":"https://api.github.com/repos/loomio/loomio/subscribers","subscription_url":"https://api.github.com/repos/loomio/loomio/subscription","commits_url":"https://api.github.com/repos/loomio/loomio/commits{/sha}","git_commits_url":"https://api.github.com/repos/loomio/loomio/git/commits{/sha}","comments_url":"https://api.github.com/repos/loomio/loomio/comments{/number}","issue_comment_url":"https://api.github.com/repos/loomio/loomio/issues/comments{/number}","contents_url":"https://api.github.com/repos/loomio/loomio/contents/{+path}","compare_url":"https://api.github.com/repos/loomio/loomio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/loomio/loomio/merges","archive_url":"https://api.github.com/repos/loomio/loomio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/loomio/loomio/downloads","issues_url":"https://api.github.com/repos/loomio/loomio/issues{/number}","pulls_url":"https://api.github.com/repos/loomio/loomio/pulls{/number}","milestones_url":"https://api.github.com/repos/loomio/loomio/milestones{/number}","notifications_url":"https://api.github.com/repos/loomio/loomio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/loomio/loomio/labels{/name}","releases_url":"https://api.github.com/repos/loomio/loomio/releases{/id}","created_at":"2011-11-08T03:27:12Z","updated_at":"2015-08-05T09:44:49Z","pushed_at":"2015-08-06T03:12:13Z","git_url":"git://github.com/loomio/loomio.git","ssh_url":"git@github.com:loomio/loomio.git","clone_url":"https://github.com/loomio/loomio.git","svn_url":"https://github.com/loomio/loomio","homepage":"www.loomio.org","size":163943,"stargazers_count":957,"watchers_count":957,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":319,"mirror_url":null,"open_issues_count":72,"forks":319,"open_issues":72,"watchers":957,"default_branch":"master"}},"base":{"label":"loomio:master","ref":"master","sha":"d9927ab2d3932fa61c8fda0db0718786b9e207ed","user":{"login":"loomio","id":1896739,"avatar_url":"https://avatars.githubusercontent.com/u/1896739?v=3","gravatar_id":"","url":"https://api.github.com/users/loomio","html_url":"https://github.com/loomio","followers_url":"https://api.github.com/users/loomio/followers","following_url":"https://api.github.com/users/loomio/following{/other_user}","gists_url":"https://api.github.com/users/loomio/gists{/gist_id}","starred_url":"https://api.github.com/users/loomio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loomio/subscriptions","organizations_url":"https://api.github.com/users/loomio/orgs","repos_url":"https://api.github.com/users/loomio/repos","events_url":"https://api.github.com/users/loomio/events{/privacy}","received_events_url":"https://api.github.com/users/loomio/received_events","type":"Organization","site_admin":false},"repo":{"id":2731301,"name":"loomio","full_name":"loomio/loomio","owner":{"login":"loomio","id":1896739,"avatar_url":"https://avatars.githubusercontent.com/u/1896739?v=3","gravatar_id":"","url":"https://api.github.com/users/loomio","html_url":"https://github.com/loomio","followers_url":"https://api.github.com/users/loomio/followers","following_url":"https://api.github.com/users/loomio/following{/other_user}","gists_url":"https://api.github.com/users/loomio/gists{/gist_id}","starred_url":"https://api.github.com/users/loomio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loomio/subscriptions","organizations_url":"https://api.github.com/users/loomio/orgs","repos_url":"https://api.github.com/users/loomio/repos","events_url":"https://api.github.com/users/loomio/events{/privacy}","received_events_url":"https://api.github.com/users/loomio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/loomio/loomio","description":"Loomio is an open-source web application that helps groups make better decisions together.","fork":false,"url":"https://api.github.com/repos/loomio/loomio","forks_url":"https://api.github.com/repos/loomio/loomio/forks","keys_url":"https://api.github.com/repos/loomio/loomio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/loomio/loomio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/loomio/loomio/teams","hooks_url":"https://api.github.com/repos/loomio/loomio/hooks","issue_events_url":"https://api.github.com/repos/loomio/loomio/issues/events{/number}","events_url":"https://api.github.com/repos/loomio/loomio/events","assignees_url":"https://api.github.com/repos/loomio/loomio/assignees{/user}","branches_url":"https://api.github.com/repos/loomio/loomio/branches{/branch}","tags_url":"https://api.github.com/repos/loomio/loomio/tags","blobs_url":"https://api.github.com/repos/loomio/loomio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/loomio/loomio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/loomio/loomio/git/refs{/sha}","trees_url":"https://api.github.com/repos/loomio/loomio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/loomio/loomio/statuses/{sha}","languages_url":"https://api.github.com/repos/loomio/loomio/languages","stargazers_url":"https://api.github.com/repos/loomio/loomio/stargazers","contributors_url":"https://api.github.com/repos/loomio/loomio/contributors","subscribers_url":"https://api.github.com/repos/loomio/loomio/subscribers","subscription_url":"https://api.github.com/repos/loomio/loomio/subscription","commits_url":"https://api.github.com/repos/loomio/loomio/commits{/sha}","git_commits_url":"https://api.github.com/repos/loomio/loomio/git/commits{/sha}","comments_url":"https://api.github.com/repos/loomio/loomio/comments{/number}","issue_comment_url":"https://api.github.com/repos/loomio/loomio/issues/comments{/number}","contents_url":"https://api.github.com/repos/loomio/loomio/contents/{+path}","compare_url":"https://api.github.com/repos/loomio/loomio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/loomio/loomio/merges","archive_url":"https://api.github.com/repos/loomio/loomio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/loomio/loomio/downloads","issues_url":"https://api.github.com/repos/loomio/loomio/issues{/number}","pulls_url":"https://api.github.com/repos/loomio/loomio/pulls{/number}","milestones_url":"https://api.github.com/repos/loomio/loomio/milestones{/number}","notifications_url":"https://api.github.com/repos/loomio/loomio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/loomio/loomio/labels{/name}","releases_url":"https://api.github.com/repos/loomio/loomio/releases{/id}","created_at":"2011-11-08T03:27:12Z","updated_at":"2015-08-05T09:44:49Z","pushed_at":"2015-08-06T03:12:13Z","git_url":"git://github.com/loomio/loomio.git","ssh_url":"git@github.com:loomio/loomio.git","clone_url":"https://github.com/loomio/loomio.git","svn_url":"https://github.com/loomio/loomio","homepage":"www.loomio.org","size":163943,"stargazers_count":957,"watchers_count":957,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":319,"mirror_url":null,"open_issues_count":72,"forks":319,"open_issues":72,"watchers":957,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/loomio/loomio/pulls/2378"},"html":{"href":"https://github.com/loomio/loomio/pull/2378"},"issue":{"href":"https://api.github.com/repos/loomio/loomio/issues/2378"},"comments":{"href":"https://api.github.com/repos/loomio/loomio/issues/2378/comments"},"review_comments":{"href":"https://api.github.com/repos/loomio/loomio/pulls/2378/comments"},"review_comment":{"href":"https://api.github.com/repos/loomio/loomio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/loomio/loomio/pulls/2378/commits"},"statuses":{"href":"https://api.github.com/repos/loomio/loomio/statuses/172f389787bdb4c927e011aa5c9eac86131d21fe"}}}}