{"action":"created","comment":{"url":"https://api.github.com/repos/matrix-org/dendrite/pulls/comments/193847805","pull_request_review_id":126905204,"id":193847805,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Mzg0NzgwNQ==","diff_hunk":"@@ -165,13 +173,20 @@ func (s *OutputRoomEventConsumer) lookupStateEvents(\n // each namespace of each registered application service, and if there is a\n // match, adds the event to the queue for events to be sent to a particular\n // application service.\n-func (s *OutputRoomEventConsumer) filterRoomserverEvents(ctx context.Context, events []gomatrixserverlib.Event) error {\n+func (s *OutputRoomEventConsumer) filterRoomserverEvents(\n+\tctx context.Context,\n+\tevents []gomatrixserverlib.Event,\n+) error {\n \tfor _, event := range events {\n \t\tfor _, appservice := range appServices {\n \t\t\t// Check if this event is interesting to this application service\n \t\t\tif s.appserviceIsInterestedInEvent(ctx, event, appservice) {\n-\t\t\t\t// TODO: Queue this event to be sent off to the application service\n-\t\t\t\tfmt.Println(appservice.ID, \"was interested in\", event.Sender(), event.Type(), event.RoomID())\n+\t\t\t\t// Queue this event to be sent off to the application service\n+\t\t\t\tif err := s.asDB.StoreEvent(ctx, appservice.ID, event); err != nil {\n+\t\t\t\t\tlog.WithError(err).Warn(\"failed to insert incoming event into appservices database\")\n+\t\t\t\t} else {\n+\t\t\t\t\tecm[appservice.ID]++","path":"src/github.com/matrix-org/dendrite/appservice/consumers/roomserver.go","position":85,"original_position":85,"commit_id":"e7b42ef706a2de771b10cd408344c7e96e23e856","original_commit_id":"e7b42ef706a2de771b10cd408344c7e96e23e856","user":{"login":"APwhitehat","id":20104174,"node_id":"MDQ6VXNlcjIwMTA0MTc0","avatar_url":"https://avatars3.githubusercontent.com/u/20104174?v=4","gravatar_id":"","url":"https://api.github.com/users/APwhitehat","html_url":"https://github.com/APwhitehat","followers_url":"https://api.github.com/users/APwhitehat/followers","following_url":"https://api.github.com/users/APwhitehat/following{/other_user}","gists_url":"https://api.github.com/users/APwhitehat/gists{/gist_id}","starred_url":"https://api.github.com/users/APwhitehat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/APwhitehat/subscriptions","organizations_url":"https://api.github.com/users/APwhitehat/orgs","repos_url":"https://api.github.com/users/APwhitehat/repos","events_url":"https://api.github.com/users/APwhitehat/events{/privacy}","received_events_url":"https://api.github.com/users/APwhitehat/received_events","type":"User","site_admin":false},"body":"concurrent map writes, yikes!","created_at":"2018-06-07T18:32:19Z","updated_at":"2018-06-07T18:32:20Z","html_url":"https://github.com/matrix-org/dendrite/pull/477#discussion_r193847805","pull_request_url":"https://api.github.com/repos/matrix-org/dendrite/pulls/477","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/matrix-org/dendrite/pulls/comments/193847805"},"html":{"href":"https://github.com/matrix-org/dendrite/pull/477#discussion_r193847805"},"pull_request":{"href":"https://api.github.com/repos/matrix-org/dendrite/pulls/477"}}},"pull_request":{"url":"https://api.github.com/repos/matrix-org/dendrite/pulls/477","id":192089057,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMDg5MDU3","html_url":"https://github.com/matrix-org/dendrite/pull/477","diff_url":"https://github.com/matrix-org/dendrite/pull/477.diff","patch_url":"https://github.com/matrix-org/dendrite/pull/477.patch","issue_url":"https://api.github.com/repos/matrix-org/dendrite/issues/477","number":477,"state":"open","locked":false,"title":"Send Application Service Events","user":{"login":"anoadragon453","id":1342360,"node_id":"MDQ6VXNlcjEzNDIzNjA=","avatar_url":"https://avatars1.githubusercontent.com/u/1342360?v=4","gravatar_id":"","url":"https://api.github.com/users/anoadragon453","html_url":"https://github.com/anoadragon453","followers_url":"https://api.github.com/users/anoadragon453/followers","following_url":"https://api.github.com/users/anoadragon453/following{/other_user}","gists_url":"https://api.github.com/users/anoadragon453/gists{/gist_id}","starred_url":"https://api.github.com/users/anoadragon453/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anoadragon453/subscriptions","organizations_url":"https://api.github.com/users/anoadragon453/orgs","repos_url":"https://api.github.com/users/anoadragon453/repos","events_url":"https://api.github.com/users/anoadragon453/events{/privacy}","received_events_url":"https://api.github.com/users/anoadragon453/received_events","type":"User","site_admin":false},"body":"Adds the database backend for the application service component, stores filtered events for goroutines for each app service to grab them and send them off to the transactions API.\r\n\r\nThe database consists of two tables, one for events, along with the app service they're destined for and some metadata. The second table is a simple relation between an app service and the last transaction ID that was used to send data to it.\r\n\r\nThe full bullet-point list of changes is below:\r\n\r\n* Modify INSTALL.md and dendrite-config.yaml for the new appservice database.\r\n* Correct all instances of casing on 'application service' to align with\r\nspec.\r\n* Store incoming events that an app service is interested in in the\r\ndatabase to be later read by transaction workers.\r\n* Retrieve these events from transaction workers, one per AS.\r\n* Minimal transaction ID data is stored as well to recover after\r\nserver failure.\r\n* Send events to AS and exponentially backoff on failure.\r\n\r\n\r\nFixes: #450 ","created_at":"2018-06-01T16:52:50Z","updated_at":"2018-06-07T18:32:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"655f005140bca1f5f55913e92e362f5f260ef9ee","assignee":{"login":"anoadragon453","id":1342360,"node_id":"MDQ6VXNlcjEzNDIzNjA=","avatar_url":"https://avatars1.githubusercontent.com/u/1342360?v=4","gravatar_id":"","url":"https://api.github.com/users/anoadragon453","html_url":"https://github.com/anoadragon453","followers_url":"https://api.github.com/users/anoadragon453/followers","following_url":"https://api.github.com/users/anoadragon453/following{/other_user}","gists_url":"https://api.github.com/users/anoadragon453/gists{/gist_id}","starred_url":"https://api.github.com/users/anoadragon453/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anoadragon453/subscriptions","organizations_url":"https://api.github.com/users/anoadragon453/orgs","repos_url":"https://api.github.com/users/anoadragon453/repos","events_url":"https://api.github.com/users/anoadragon453/events{/privacy}","received_events_url":"https://api.github.com/users/anoadragon453/received_events","type":"User","site_admin":false},"assignees":[{"login":"anoadragon453","id":1342360,"node_id":"MDQ6VXNlcjEzNDIzNjA=","avatar_url":"https://avatars1.githubusercontent.com/u/1342360?v=4","gravatar_id":"","url":"https://api.github.com/users/anoadragon453","html_url":"https://github.com/anoadragon453","followers_url":"https://api.github.com/users/anoadragon453/followers","following_url":"https://api.github.com/users/anoadragon453/following{/other_user}","gists_url":"https://api.github.com/users/anoadragon453/gists{/gist_id}","starred_url":"https://api.github.com/users/anoadragon453/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anoadragon453/subscriptions","organizations_url":"https://api.github.com/users/anoadragon453/orgs","repos_url":"https://api.github.com/users/anoadragon453/repos","events_url":"https://api.github.com/users/anoadragon453/events{/privacy}","received_events_url":"https://api.github.com/users/anoadragon453/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/matrix-org/dendrite/pulls/477/commits","review_comments_url":"https://api.github.com/repos/matrix-org/dendrite/pulls/477/comments","review_comment_url":"https://api.github.com/repos/matrix-org/dendrite/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matrix-org/dendrite/issues/477/comments","statuses_url":"https://api.github.com/repos/matrix-org/dendrite/statuses/e7b42ef706a2de771b10cd408344c7e96e23e856","head":{"label":"matrix-org:anoa/as_forward_events","ref":"anoa/as_forward_events","sha":"e7b42ef706a2de771b10cd408344c7e96e23e856","user":{"login":"matrix-org","id":8418310,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0MTgzMTA=","avatar_url":"https://avatars2.githubusercontent.com/u/8418310?v=4","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"repo":{"id":79585104,"node_id":"MDEwOlJlcG9zaXRvcnk3OTU4NTEwNA==","name":"dendrite","full_name":"matrix-org/dendrite","owner":{"login":"matrix-org","id":8418310,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0MTgzMTA=","avatar_url":"https://avatars2.githubusercontent.com/u/8418310?v=4","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matrix-org/dendrite","description":"Dendrite will be a matrix homeserver written in go","fork":false,"url":"https://api.github.com/repos/matrix-org/dendrite","forks_url":"https://api.github.com/repos/matrix-org/dendrite/forks","keys_url":"https://api.github.com/repos/matrix-org/dendrite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-org/dendrite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-org/dendrite/teams","hooks_url":"https://api.github.com/repos/matrix-org/dendrite/hooks","issue_events_url":"https://api.github.com/repos/matrix-org/dendrite/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-org/dendrite/events","assignees_url":"https://api.github.com/repos/matrix-org/dendrite/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-org/dendrite/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-org/dendrite/tags","blobs_url":"https://api.github.com/repos/matrix-org/dendrite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-org/dendrite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-org/dendrite/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-org/dendrite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-org/dendrite/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-org/dendrite/languages","stargazers_url":"https://api.github.com/repos/matrix-org/dendrite/stargazers","contributors_url":"https://api.github.com/repos/matrix-org/dendrite/contributors","subscribers_url":"https://api.github.com/repos/matrix-org/dendrite/subscribers","subscription_url":"https://api.github.com/repos/matrix-org/dendrite/subscription","commits_url":"https://api.github.com/repos/matrix-org/dendrite/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-org/dendrite/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-org/dendrite/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-org/dendrite/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-org/dendrite/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-org/dendrite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-org/dendrite/merges","archive_url":"https://api.github.com/repos/matrix-org/dendrite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-org/dendrite/downloads","issues_url":"https://api.github.com/repos/matrix-org/dendrite/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-org/dendrite/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-org/dendrite/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-org/dendrite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-org/dendrite/labels{/name}","releases_url":"https://api.github.com/repos/matrix-org/dendrite/releases{/id}","deployments_url":"https://api.github.com/repos/matrix-org/dendrite/deployments","created_at":"2017-01-20T18:22:16Z","updated_at":"2018-06-07T14:00:11Z","pushed_at":"2018-06-07T17:12:10Z","git_url":"git://github.com/matrix-org/dendrite.git","ssh_url":"git@github.com:matrix-org/dendrite.git","clone_url":"https://github.com/matrix-org/dendrite.git","svn_url":"https://github.com/matrix-org/dendrite","homepage":"","size":27883,"stargazers_count":318,"watchers_count":318,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":56,"mirror_url":null,"archived":false,"open_issues_count":75,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":56,"open_issues":75,"watchers":318,"default_branch":"master"}},"base":{"label":"matrix-org:master","ref":"master","sha":"241b1b5ace677d81207299e52e2f6ac5f3f547b1","user":{"login":"matrix-org","id":8418310,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0MTgzMTA=","avatar_url":"https://avatars2.githubusercontent.com/u/8418310?v=4","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"repo":{"id":79585104,"node_id":"MDEwOlJlcG9zaXRvcnk3OTU4NTEwNA==","name":"dendrite","full_name":"matrix-org/dendrite","owner":{"login":"matrix-org","id":8418310,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0MTgzMTA=","avatar_url":"https://avatars2.githubusercontent.com/u/8418310?v=4","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matrix-org/dendrite","description":"Dendrite will be a matrix homeserver written in go","fork":false,"url":"https://api.github.com/repos/matrix-org/dendrite","forks_url":"https://api.github.com/repos/matrix-org/dendrite/forks","keys_url":"https://api.github.com/repos/matrix-org/dendrite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-org/dendrite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-org/dendrite/teams","hooks_url":"https://api.github.com/repos/matrix-org/dendrite/hooks","issue_events_url":"https://api.github.com/repos/matrix-org/dendrite/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-org/dendrite/events","assignees_url":"https://api.github.com/repos/matrix-org/dendrite/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-org/dendrite/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-org/dendrite/tags","blobs_url":"https://api.github.com/repos/matrix-org/dendrite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-org/dendrite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-org/dendrite/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-org/dendrite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-org/dendrite/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-org/dendrite/languages","stargazers_url":"https://api.github.com/repos/matrix-org/dendrite/stargazers","contributors_url":"https://api.github.com/repos/matrix-org/dendrite/contributors","subscribers_url":"https://api.github.com/repos/matrix-org/dendrite/subscribers","subscription_url":"https://api.github.com/repos/matrix-org/dendrite/subscription","commits_url":"https://api.github.com/repos/matrix-org/dendrite/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-org/dendrite/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-org/dendrite/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-org/dendrite/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-org/dendrite/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-org/dendrite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-org/dendrite/merges","archive_url":"https://api.github.com/repos/matrix-org/dendrite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-org/dendrite/downloads","issues_url":"https://api.github.com/repos/matrix-org/dendrite/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-org/dendrite/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-org/dendrite/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-org/dendrite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-org/dendrite/labels{/name}","releases_url":"https://api.github.com/repos/matrix-org/dendrite/releases{/id}","deployments_url":"https://api.github.com/repos/matrix-org/dendrite/deployments","created_at":"2017-01-20T18:22:16Z","updated_at":"2018-06-07T14:00:11Z","pushed_at":"2018-06-07T17:12:10Z","git_url":"git://github.com/matrix-org/dendrite.git","ssh_url":"git@github.com:matrix-org/dendrite.git","clone_url":"https://github.com/matrix-org/dendrite.git","svn_url":"https://github.com/matrix-org/dendrite","homepage":"","size":27883,"stargazers_count":318,"watchers_count":318,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":56,"mirror_url":null,"archived":false,"open_issues_count":75,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":56,"open_issues":75,"watchers":318,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matrix-org/dendrite/pulls/477"},"html":{"href":"https://github.com/matrix-org/dendrite/pull/477"},"issue":{"href":"https://api.github.com/repos/matrix-org/dendrite/issues/477"},"comments":{"href":"https://api.github.com/repos/matrix-org/dendrite/issues/477/comments"},"review_comments":{"href":"https://api.github.com/repos/matrix-org/dendrite/pulls/477/comments"},"review_comment":{"href":"https://api.github.com/repos/matrix-org/dendrite/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matrix-org/dendrite/pulls/477/commits"},"statuses":{"href":"https://api.github.com/repos/matrix-org/dendrite/statuses/e7b42ef706a2de771b10cd408344c7e96e23e856"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"APwhitehat"}}