{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/245172507","pull_request_review_id":189231189,"id":245172507,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTE3MjUwNw==","diff_hunk":"@@ -576,23 +589,46 @@ public ITableEntriesSnapshot GetSnapshot(int versionNumber)\n \n             void IDisposable.Dispose()\n             {\n-                this.Presenter.AssertIsForeground();\n+            }\n \n-                // VS is letting go of us.  i.e. because a new FAR call is happening, or because\n-                // of some other event (like the solution being closed).  Remove us from the set\n-                // of sources for the window so that the existing data is cleared out.\n-                Debug.Assert(_findReferencesWindow.Manager.Sources.Count == 1);\n-                Debug.Assert(_findReferencesWindow.Manager.Sources[0] == this);\n+            #endregion\n \n-                _findReferencesWindow.Manager.RemoveSource(this);\n+            private void RemoveSink(ITableDataSink sink)\n+            {\n+                ImmutableInterlocked.Update(ref _tableDataSinks, (sinks, arg) => sinks.Remove(arg), sink);\n \n-                CancelSearch();\n+                if (_tableDataSinks.IsEmpty)\n+                {\n+                    // TODO: Why is this a safe assumption? Where is the contract that these subscriptions are only disposed on the main thread?\n+                    //       Even if VS always does it, other folks can add their own sinks, and if the requirement isn't documented,\n+                    //       others may dispose on another thread.\n+                    Presenter.AssertIsForeground();","path":"src/VisualStudio/Core/Def/Implementation/FindReferences/Contexts/AbstractTableDataSourceFindUsagesContext.cs","position":148,"original_position":148,"commit_id":"ae80c9d496000c50762e9afa154ea42f3fc96563","original_commit_id":"ae80c9d496000c50762e9afa154ea42f3fc96563","user":{"login":"CyrusNajmabadi","id":4564579,"node_id":"MDQ6VXNlcjQ1NjQ1Nzk=","avatar_url":"https://avatars3.githubusercontent.com/u/4564579?v=4","gravatar_id":"","url":"https://api.github.com/users/CyrusNajmabadi","html_url":"https://github.com/CyrusNajmabadi","followers_url":"https://api.github.com/users/CyrusNajmabadi/followers","following_url":"https://api.github.com/users/CyrusNajmabadi/following{/other_user}","gists_url":"https://api.github.com/users/CyrusNajmabadi/gists{/gist_id}","starred_url":"https://api.github.com/users/CyrusNajmabadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyrusNajmabadi/subscriptions","organizations_url":"https://api.github.com/users/CyrusNajmabadi/orgs","repos_url":"https://api.github.com/users/CyrusNajmabadi/repos","events_url":"https://api.github.com/users/CyrusNajmabadi/events{/privacy}","received_events_url":"https://api.github.com/users/CyrusNajmabadi/received_events","type":"User","site_admin":false},"body":"this was communicated by the editor team as to how this will behave.  ANd our assert checks this (inlcuding in Release builds iirc) to verify this so that if that contract is violated we can inform them immediately.","created_at":"2019-01-04T00:08:48Z","updated_at":"2019-01-04T00:08:48Z","html_url":"https://github.com/dotnet/roslyn/pull/32136#discussion_r245172507","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/32136","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/245172507"},"html":{"href":"https://github.com/dotnet/roslyn/pull/32136#discussion_r245172507"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/32136"}},"in_reply_to_id":245143450},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/32136","id":242119453,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQyMTE5NDUz","html_url":"https://github.com/dotnet/roslyn/pull/32136","diff_url":"https://github.com/dotnet/roslyn/pull/32136.diff","patch_url":"https://github.com/dotnet/roslyn/pull/32136.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/32136","number":32136,"state":"open","locked":false,"title":"Fix ITableDataSource support for multiple sinks","user":{"login":"AArnott","id":3548,"node_id":"MDQ6VXNlcjM1NDg=","avatar_url":"https://avatars2.githubusercontent.com/u/3548?v=4","gravatar_id":"","url":"https://api.github.com/users/AArnott","html_url":"https://github.com/AArnott","followers_url":"https://api.github.com/users/AArnott/followers","following_url":"https://api.github.com/users/AArnott/following{/other_user}","gists_url":"https://api.github.com/users/AArnott/gists{/gist_id}","starred_url":"https://api.github.com/users/AArnott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AArnott/subscriptions","organizations_url":"https://api.github.com/users/AArnott/orgs","repos_url":"https://api.github.com/users/AArnott/repos","events_url":"https://api.github.com/users/AArnott/events{/privacy}","received_events_url":"https://api.github.com/users/AArnott/received_events","type":"User","site_admin":false},"body":"While the VS TDS only adds one sink of its own, this is something of an implementation detail, and doesn't support anyone else adding their own sink, which would lead to this code malfunctioning.\r\nWith this change, the FindUsages code tracks and updates all sinks, and only terminates an async search when *all* sinks have been removed.","created_at":"2019-01-03T21:45:45Z","updated_at":"2019-01-04T00:08:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"73ecd93ef035baab589b9a42b1f014b263e4a2c9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"roslyn-ide","id":1781706,"node_id":"MDQ6VGVhbTE3ODE3MDY=","slug":"roslyn-ide","description":"Roslyn IDE Team","privacy":"closed","url":"https://api.github.com/teams/1781706","members_url":"https://api.github.com/teams/1781706/members{/member}","repositories_url":"https://api.github.com/teams/1781706/repos","permission":"pull"}],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/32136/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/32136/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/32136/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/ae80c9d496000c50762e9afa154ea42f3fc96563","head":{"label":"AArnott:MultipleTableSinks","ref":"MultipleTableSinks","sha":"ae80c9d496000c50762e9afa154ea42f3fc96563","user":{"login":"AArnott","id":3548,"node_id":"MDQ6VXNlcjM1NDg=","avatar_url":"https://avatars2.githubusercontent.com/u/3548?v=4","gravatar_id":"","url":"https://api.github.com/users/AArnott","html_url":"https://github.com/AArnott","followers_url":"https://api.github.com/users/AArnott/followers","following_url":"https://api.github.com/users/AArnott/following{/other_user}","gists_url":"https://api.github.com/users/AArnott/gists{/gist_id}","starred_url":"https://api.github.com/users/AArnott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AArnott/subscriptions","organizations_url":"https://api.github.com/users/AArnott/orgs","repos_url":"https://api.github.com/users/AArnott/repos","events_url":"https://api.github.com/users/AArnott/events{/privacy}","received_events_url":"https://api.github.com/users/AArnott/received_events","type":"User","site_admin":false},"repo":{"id":30741372,"node_id":"MDEwOlJlcG9zaXRvcnkzMDc0MTM3Mg==","name":"roslyn","full_name":"AArnott/roslyn","private":false,"owner":{"login":"AArnott","id":3548,"node_id":"MDQ6VXNlcjM1NDg=","avatar_url":"https://avatars2.githubusercontent.com/u/3548?v=4","gravatar_id":"","url":"https://api.github.com/users/AArnott","html_url":"https://github.com/AArnott","followers_url":"https://api.github.com/users/AArnott/followers","following_url":"https://api.github.com/users/AArnott/following{/other_user}","gists_url":"https://api.github.com/users/AArnott/gists{/gist_id}","starred_url":"https://api.github.com/users/AArnott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AArnott/subscriptions","organizations_url":"https://api.github.com/users/AArnott/orgs","repos_url":"https://api.github.com/users/AArnott/repos","events_url":"https://api.github.com/users/AArnott/events{/privacy}","received_events_url":"https://api.github.com/users/AArnott/received_events","type":"User","site_admin":false},"html_url":"https://github.com/AArnott/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/AArnott/roslyn","forks_url":"https://api.github.com/repos/AArnott/roslyn/forks","keys_url":"https://api.github.com/repos/AArnott/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AArnott/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AArnott/roslyn/teams","hooks_url":"https://api.github.com/repos/AArnott/roslyn/hooks","issue_events_url":"https://api.github.com/repos/AArnott/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/AArnott/roslyn/events","assignees_url":"https://api.github.com/repos/AArnott/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/AArnott/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/AArnott/roslyn/tags","blobs_url":"https://api.github.com/repos/AArnott/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AArnott/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AArnott/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/AArnott/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AArnott/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/AArnott/roslyn/languages","stargazers_url":"https://api.github.com/repos/AArnott/roslyn/stargazers","contributors_url":"https://api.github.com/repos/AArnott/roslyn/contributors","subscribers_url":"https://api.github.com/repos/AArnott/roslyn/subscribers","subscription_url":"https://api.github.com/repos/AArnott/roslyn/subscription","commits_url":"https://api.github.com/repos/AArnott/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/AArnott/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/AArnott/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/AArnott/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/AArnott/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/AArnott/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AArnott/roslyn/merges","archive_url":"https://api.github.com/repos/AArnott/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AArnott/roslyn/downloads","issues_url":"https://api.github.com/repos/AArnott/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/AArnott/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/AArnott/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/AArnott/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AArnott/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/AArnott/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/AArnott/roslyn/deployments","created_at":"2015-02-13T05:09:49Z","updated_at":"2016-11-30T05:34:20Z","pushed_at":"2019-01-03T21:44:33Z","git_url":"git://github.com/AArnott/roslyn.git","ssh_url":"git@github.com:AArnott/roslyn.git","clone_url":"https://github.com/AArnott/roslyn.git","svn_url":"https://github.com/AArnott/roslyn","homepage":"","size":484186,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"66c6a7d34d5ca96e8c08120d686203cdbc1b7714","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"node_id":"MDEwOlJlcG9zaXRvcnkyOTA3ODk5Nw==","name":"roslyn","full_name":"dotnet/roslyn","private":false,"owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dotnet/roslyn","description":"The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2019-01-03T23:41:18Z","pushed_at":"2019-01-04T00:06:46Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/","size":518147,"stargazers_count":10587,"watchers_count":10587,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2502,"mirror_url":null,"archived":false,"open_issues_count":5587,"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":2502,"open_issues":5587,"watchers":10587,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/32136"},"html":{"href":"https://github.com/dotnet/roslyn/pull/32136"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/32136"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/32136/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/32136/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/32136/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/ae80c9d496000c50762e9afa154ea42f3fc96563"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"CyrusNajmabadi"}}