madskristensen / MIDL

A Visual Studio extension
Apache License 2.0
24 stars 5 forks source link

IDL Merge window is buggy, make users unable to close the file, save prompt doesn't show up, etc #6

Closed roxk closed 1 year ago

roxk commented 2 years ago

Describe the bug There are several symptoms for this bugs. Including window tab would switch to IDL Merge but the content doesn't change, unable to close header file that had just been diff-ed, IDL Merge's save confirmation prompt sometimes doesn't show up. These can all be reproduced with the following steps intermittently.

To Reproduce Steps to reproduce the behavior:

  1. Open the header file for the idl
  2. Right click the idl in solution explorer and click update header file
  3. See git tool shows
  4. Close git tool, click don't save (sometimes the save prompt doesn't even show up)
  5. See result still saved to the header file, and the file cannot be closed anymore. A dialog would show saying operation failed, unspecified error

Expected behavior

  1. IDL Merge window is reliable
  2. Can close the header file
  3. IDL Merge window would show confirmation dialog always

Screenshots IDL Merge Window shows up without content https://user-images.githubusercontent.com/16918354/197330072-1f5c76bb-217e-4f70-afae-dd8c97245817.mp4

Cannot close header file, no save prompt https://user-images.githubusercontent.com/16918354/197330094-e4238654-a7e8-4731-9a0b-849c8dcea833.mp4 Note - in the last couple seconds I was dragging the VS error dialog saying there was unspecified error, but game bar couldn't capture it.

Additional context Digging the code and comparing it with the real merge editor workflow, I think the error is in this line: https://github.com/madskristensen/MIDL/blob/master/src/MIDL/Commands/UpdateHeaderFile.cs#L97

Specifically, the project file is passed as left file directly to the merge service. In the merge editor invoked by real merge conflict, it seems the left file is a temporary. As shown in the following screenshots:

Editor invoked by merge conflict, the result file content is out right different from the actual header file Screenshot 2022-10-22 153201

Editor invoked by merge conflict, the file name in save confirmation prompt is a temporary one Screenshot 2022-10-22 153220

IDL Merge editor, save confirmation prompt uses the real file name Screenshot 2022-10-22 152857

roxk commented 1 year ago

Confirm fixed.