Fix race condition in SolutionExplorer_InProc.OpenFile#26265
Fix race condition in SolutionExplorer_InProc.OpenFile#26265sharwell merged 2 commits intodotnet:dev15.7.xfrom
Conversation
jfleisher
left a comment
There was a problem hiding this comment.
Validated all integration tests locally. All is we.
|
@jfleisher It broke a few tests for a reason I knew was a possibility¹, but wasn't sure which test would be impacted. I'll get that fixed. ¹ The old code could open any file from disk, but the new code |
There was a problem hiding this comment.
Should this get a comment here? As you know, my faith in people carefully inspecting history is...low. 😄
There was a problem hiding this comment.
("this is how it should have been written in the first place" is quite possibly a valid counter here...never like comments that explain why the previous, obviously bad code was bad)
Completely rewrote the implementation
This change updates the file open implementation use VsShellUtilities.OpenDocument. DTE plus waiting for the active window title alone proved insufficient, where some tests were incorrectly operating on the previous active document. Fixes dotnet#19191 Fixes dotnet#26037
|
@jasonmalinowski I didn't want to resort to ff77b97 but I was still seeing failures without it. 😞 I went with this approach. Some of the inconsistencies - specifically focus issues - revealed by iterative testing (running hundreds of times in sequence) appear to match behavior anomalies I've observed during daily coding. |
|
Merged test only change |
This change updates the code to use
ProjectItem.Openinstead of relying on the asynchronous File Open command. Prior to the change, the method would occasionally return early, allowing the caller to modify the previous active document before the newly opened document was fully activated.Fixes #19191
Fixes #26037
Closes #26205