{"action":"created","comment":{"url":"https://api.github.com/repos/girder/girder/pulls/comments/204886616","pull_request_review_id":140049122,"id":204886616,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDg4NjYxNg==","diff_hunk":"@@ -105,3 +106,23 @@ def streamGen():\n \n                 time.sleep(wait)\n         return streamGen\n+\n+    @access.cookie\n+    @access.token\n+    @autoDescribeRoute(\n+        Description('List notification events')\n+        .notes('This endpoint can be used for manual long-polling when '\n+               'SSE support is disabled or otherwise unavailable.')\n+        .param('since', 'Filter out events before this time stamp.',\n+               dataType='integer', required=False)\n+        .errorResponse()\n+        .errorResponse('You are not logged in.', 403)\n+    )\n+    def listNotifications(self, params):\n+        user, token = self.getCurrentUser(returnToken=True)\n+        since = params.get('since')\n+        setResponseHeader('Date', str(time.time()))","path":"girder/api/v1/notification.py","position":null,"original_position":27,"commit_id":"f649421e7214e309a69badafbbf4ae2736bdc5f5","original_commit_id":"684a764c5e2748c6c6a033de984997b42a4091fe","user":{"login":"jbeezley","id":31890,"node_id":"MDQ6VXNlcjMxODkw","avatar_url":"https://avatars2.githubusercontent.com/u/31890?v=4","gravatar_id":"","url":"https://api.github.com/users/jbeezley","html_url":"https://github.com/jbeezley","followers_url":"https://api.github.com/users/jbeezley/followers","following_url":"https://api.github.com/users/jbeezley/following{/other_user}","gists_url":"https://api.github.com/users/jbeezley/gists{/gist_id}","starred_url":"https://api.github.com/users/jbeezley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbeezley/subscriptions","organizations_url":"https://api.github.com/users/jbeezley/orgs","repos_url":"https://api.github.com/users/jbeezley/repos","events_url":"https://api.github.com/users/jbeezley/events{/privacy}","received_events_url":"https://api.github.com/users/jbeezley/received_events","type":"User","site_admin":false},"body":"I fixed it the best I could.  We can't always use the same method as the notification stream because there won't always be a notification to send back.  As you said though, these race conditions are possible regardless.","created_at":"2018-07-24T19:43:06Z","updated_at":"2018-07-24T19:43:06Z","html_url":"https://github.com/girder/girder/pull/2768#discussion_r204886616","pull_request_url":"https://api.github.com/repos/girder/girder/pulls/2768","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/girder/girder/pulls/comments/204886616"},"html":{"href":"https://github.com/girder/girder/pull/2768#discussion_r204886616"},"pull_request":{"href":"https://api.github.com/repos/girder/girder/pulls/2768"}},"in_reply_to_id":204880070},"pull_request":{"url":"https://api.github.com/repos/girder/girder/pulls/2768","id":203529672,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzNTI5Njcy","html_url":"https://github.com/girder/girder/pull/2768","diff_url":"https://github.com/girder/girder/pull/2768.diff","patch_url":"https://github.com/girder/girder/pull/2768.patch","issue_url":"https://api.github.com/repos/girder/girder/issues/2768","number":2768,"state":"open","locked":false,"title":"[WIP] Add an endpoint to poll for notifications","user":{"login":"jbeezley","id":31890,"node_id":"MDQ6VXNlcjMxODkw","avatar_url":"https://avatars2.githubusercontent.com/u/31890?v=4","gravatar_id":"","url":"https://api.github.com/users/jbeezley","html_url":"https://github.com/jbeezley","followers_url":"https://api.github.com/users/jbeezley/followers","following_url":"https://api.github.com/users/jbeezley/following{/other_user}","gists_url":"https://api.github.com/users/jbeezley/gists{/gist_id}","starred_url":"https://api.github.com/users/jbeezley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbeezley/subscriptions","organizations_url":"https://api.github.com/users/jbeezley/orgs","repos_url":"https://api.github.com/users/jbeezley/repos","events_url":"https://api.github.com/users/jbeezley/events{/privacy}","received_events_url":"https://api.github.com/users/jbeezley/received_events","type":"User","site_admin":false},"body":"This adds a notification listing endpoint at `/notification`.  It returns the same information provided by `/notification/stream`, but without the issues with long-lived request threads.  It would be up to the client to fall back to manual long polling.\r\n\r\nThe implementation is simple, but I'll add a test if everyone agrees this is a good idea.","created_at":"2018-07-24T13:37:47Z","updated_at":"2018-07-24T19:43:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4a43af65fa3fbc27b9c8e9e426d1a8dc261ef6a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/girder/girder/pulls/2768/commits","review_comments_url":"https://api.github.com/repos/girder/girder/pulls/2768/comments","review_comment_url":"https://api.github.com/repos/girder/girder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/girder/girder/issues/2768/comments","statuses_url":"https://api.github.com/repos/girder/girder/statuses/f649421e7214e309a69badafbbf4ae2736bdc5f5","head":{"label":"girder:sse-polling","ref":"sse-polling","sha":"f649421e7214e309a69badafbbf4ae2736bdc5f5","user":{"login":"girder","id":5150517,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUxNTA1MTc=","avatar_url":"https://avatars2.githubusercontent.com/u/5150517?v=4","gravatar_id":"","url":"https://api.github.com/users/girder","html_url":"https://github.com/girder","followers_url":"https://api.github.com/users/girder/followers","following_url":"https://api.github.com/users/girder/following{/other_user}","gists_url":"https://api.github.com/users/girder/gists{/gist_id}","starred_url":"https://api.github.com/users/girder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/girder/subscriptions","organizations_url":"https://api.github.com/users/girder/orgs","repos_url":"https://api.github.com/users/girder/repos","events_url":"https://api.github.com/users/girder/events{/privacy}","received_events_url":"https://api.github.com/users/girder/received_events","type":"Organization","site_admin":false},"repo":{"id":11854950,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg1NDk1MA==","name":"girder","full_name":"girder/girder","owner":{"login":"girder","id":5150517,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUxNTA1MTc=","avatar_url":"https://avatars2.githubusercontent.com/u/5150517?v=4","gravatar_id":"","url":"https://api.github.com/users/girder","html_url":"https://github.com/girder","followers_url":"https://api.github.com/users/girder/followers","following_url":"https://api.github.com/users/girder/following{/other_user}","gists_url":"https://api.github.com/users/girder/gists{/gist_id}","starred_url":"https://api.github.com/users/girder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/girder/subscriptions","organizations_url":"https://api.github.com/users/girder/orgs","repos_url":"https://api.github.com/users/girder/repos","events_url":"https://api.github.com/users/girder/events{/privacy}","received_events_url":"https://api.github.com/users/girder/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/girder/girder","description":"A data management platform for the web, developed by Kitware","fork":false,"url":"https://api.github.com/repos/girder/girder","forks_url":"https://api.github.com/repos/girder/girder/forks","keys_url":"https://api.github.com/repos/girder/girder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/girder/girder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/girder/girder/teams","hooks_url":"https://api.github.com/repos/girder/girder/hooks","issue_events_url":"https://api.github.com/repos/girder/girder/issues/events{/number}","events_url":"https://api.github.com/repos/girder/girder/events","assignees_url":"https://api.github.com/repos/girder/girder/assignees{/user}","branches_url":"https://api.github.com/repos/girder/girder/branches{/branch}","tags_url":"https://api.github.com/repos/girder/girder/tags","blobs_url":"https://api.github.com/repos/girder/girder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/girder/girder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/girder/girder/git/refs{/sha}","trees_url":"https://api.github.com/repos/girder/girder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/girder/girder/statuses/{sha}","languages_url":"https://api.github.com/repos/girder/girder/languages","stargazers_url":"https://api.github.com/repos/girder/girder/stargazers","contributors_url":"https://api.github.com/repos/girder/girder/contributors","subscribers_url":"https://api.github.com/repos/girder/girder/subscribers","subscription_url":"https://api.github.com/repos/girder/girder/subscription","commits_url":"https://api.github.com/repos/girder/girder/commits{/sha}","git_commits_url":"https://api.github.com/repos/girder/girder/git/commits{/sha}","comments_url":"https://api.github.com/repos/girder/girder/comments{/number}","issue_comment_url":"https://api.github.com/repos/girder/girder/issues/comments{/number}","contents_url":"https://api.github.com/repos/girder/girder/contents/{+path}","compare_url":"https://api.github.com/repos/girder/girder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/girder/girder/merges","archive_url":"https://api.github.com/repos/girder/girder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/girder/girder/downloads","issues_url":"https://api.github.com/repos/girder/girder/issues{/number}","pulls_url":"https://api.github.com/repos/girder/girder/pulls{/number}","milestones_url":"https://api.github.com/repos/girder/girder/milestones{/number}","notifications_url":"https://api.github.com/repos/girder/girder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/girder/girder/labels{/name}","releases_url":"https://api.github.com/repos/girder/girder/releases{/id}","deployments_url":"https://api.github.com/repos/girder/girder/deployments","created_at":"2013-08-02T23:55:54Z","updated_at":"2018-07-23T16:07:31Z","pushed_at":"2018-07-24T19:40:53Z","git_url":"git://github.com/girder/girder.git","ssh_url":"git@github.com:girder/girder.git","clone_url":"https://github.com/girder/girder.git","svn_url":"https://github.com/girder/girder","homepage":"http://girder.readthedocs.io","size":16316,"stargazers_count":209,"watchers_count":209,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":96,"mirror_url":null,"archived":false,"open_issues_count":354,"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":96,"open_issues":354,"watchers":209,"default_branch":"master"}},"base":{"label":"girder:master","ref":"master","sha":"6d574cd837226c8344202ceb81276a8fc2febd7b","user":{"login":"girder","id":5150517,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUxNTA1MTc=","avatar_url":"https://avatars2.githubusercontent.com/u/5150517?v=4","gravatar_id":"","url":"https://api.github.com/users/girder","html_url":"https://github.com/girder","followers_url":"https://api.github.com/users/girder/followers","following_url":"https://api.github.com/users/girder/following{/other_user}","gists_url":"https://api.github.com/users/girder/gists{/gist_id}","starred_url":"https://api.github.com/users/girder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/girder/subscriptions","organizations_url":"https://api.github.com/users/girder/orgs","repos_url":"https://api.github.com/users/girder/repos","events_url":"https://api.github.com/users/girder/events{/privacy}","received_events_url":"https://api.github.com/users/girder/received_events","type":"Organization","site_admin":false},"repo":{"id":11854950,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg1NDk1MA==","name":"girder","full_name":"girder/girder","owner":{"login":"girder","id":5150517,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUxNTA1MTc=","avatar_url":"https://avatars2.githubusercontent.com/u/5150517?v=4","gravatar_id":"","url":"https://api.github.com/users/girder","html_url":"https://github.com/girder","followers_url":"https://api.github.com/users/girder/followers","following_url":"https://api.github.com/users/girder/following{/other_user}","gists_url":"https://api.github.com/users/girder/gists{/gist_id}","starred_url":"https://api.github.com/users/girder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/girder/subscriptions","organizations_url":"https://api.github.com/users/girder/orgs","repos_url":"https://api.github.com/users/girder/repos","events_url":"https://api.github.com/users/girder/events{/privacy}","received_events_url":"https://api.github.com/users/girder/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/girder/girder","description":"A data management platform for the web, developed by Kitware","fork":false,"url":"https://api.github.com/repos/girder/girder","forks_url":"https://api.github.com/repos/girder/girder/forks","keys_url":"https://api.github.com/repos/girder/girder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/girder/girder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/girder/girder/teams","hooks_url":"https://api.github.com/repos/girder/girder/hooks","issue_events_url":"https://api.github.com/repos/girder/girder/issues/events{/number}","events_url":"https://api.github.com/repos/girder/girder/events","assignees_url":"https://api.github.com/repos/girder/girder/assignees{/user}","branches_url":"https://api.github.com/repos/girder/girder/branches{/branch}","tags_url":"https://api.github.com/repos/girder/girder/tags","blobs_url":"https://api.github.com/repos/girder/girder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/girder/girder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/girder/girder/git/refs{/sha}","trees_url":"https://api.github.com/repos/girder/girder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/girder/girder/statuses/{sha}","languages_url":"https://api.github.com/repos/girder/girder/languages","stargazers_url":"https://api.github.com/repos/girder/girder/stargazers","contributors_url":"https://api.github.com/repos/girder/girder/contributors","subscribers_url":"https://api.github.com/repos/girder/girder/subscribers","subscription_url":"https://api.github.com/repos/girder/girder/subscription","commits_url":"https://api.github.com/repos/girder/girder/commits{/sha}","git_commits_url":"https://api.github.com/repos/girder/girder/git/commits{/sha}","comments_url":"https://api.github.com/repos/girder/girder/comments{/number}","issue_comment_url":"https://api.github.com/repos/girder/girder/issues/comments{/number}","contents_url":"https://api.github.com/repos/girder/girder/contents/{+path}","compare_url":"https://api.github.com/repos/girder/girder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/girder/girder/merges","archive_url":"https://api.github.com/repos/girder/girder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/girder/girder/downloads","issues_url":"https://api.github.com/repos/girder/girder/issues{/number}","pulls_url":"https://api.github.com/repos/girder/girder/pulls{/number}","milestones_url":"https://api.github.com/repos/girder/girder/milestones{/number}","notifications_url":"https://api.github.com/repos/girder/girder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/girder/girder/labels{/name}","releases_url":"https://api.github.com/repos/girder/girder/releases{/id}","deployments_url":"https://api.github.com/repos/girder/girder/deployments","created_at":"2013-08-02T23:55:54Z","updated_at":"2018-07-23T16:07:31Z","pushed_at":"2018-07-24T19:40:53Z","git_url":"git://github.com/girder/girder.git","ssh_url":"git@github.com:girder/girder.git","clone_url":"https://github.com/girder/girder.git","svn_url":"https://github.com/girder/girder","homepage":"http://girder.readthedocs.io","size":16316,"stargazers_count":209,"watchers_count":209,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":96,"mirror_url":null,"archived":false,"open_issues_count":354,"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":96,"open_issues":354,"watchers":209,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/girder/girder/pulls/2768"},"html":{"href":"https://github.com/girder/girder/pull/2768"},"issue":{"href":"https://api.github.com/repos/girder/girder/issues/2768"},"comments":{"href":"https://api.github.com/repos/girder/girder/issues/2768/comments"},"review_comments":{"href":"https://api.github.com/repos/girder/girder/pulls/2768/comments"},"review_comment":{"href":"https://api.github.com/repos/girder/girder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/girder/girder/pulls/2768/commits"},"statuses":{"href":"https://api.github.com/repos/girder/girder/statuses/f649421e7214e309a69badafbbf4ae2736bdc5f5"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jbeezley"}}