-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Clicking an Image file in the project tree calls FileOpen command twice #6001
Comments
This is less bad now that #6002 has landed: FileViewController still tried to open the same image a second time, but DocumentCommangHandlers is smart enough to no-op |
Made it low priority and assigned it to @couzteau. |
This only occurs when switching from a text file to an image. When going from an image to another image the bug does not ocur. |
I believe the root cause is a race condition. |
Another way of putting it: the 2nd trigger the comes from EditorManager in showCustomViewer via _setCurrentlyViewedPath is completely wrong. That one should not result in an Open command. That event is sent after showing the image to update the tree. But tree selection should happen before the first open command in ProjectManager, same as text files. side note: This also work for image files when switching from one image to another. |
posted fix on branch: https://github.com/adobe/brackets/tree/couzteau/fix-6001-imgPreview-dupeOpen |
The fix is not good because removing the clearCurrentDocument call prevents the currentDocumentChange event to be sent, breaking the unit test. |
@peterflynn Time for the code review of the fix? |
I've just confirmed that this will be fixed when the project manager revamp (#8788) lands. |
Cools |
FBNC @couzteau |
Confirming fix. Closing. |
result image is opened.
Bug: break point is hit twice. because ProjectManager will run
In case of displaying an image the 2nd pass is completely redundant because the image is already in view.
But the 2nd pass is not expected by the Jasmine test runner thus events from the 2nd run may mess op subsequent tests, i.e. tests that are counting events sent on fileOpen.
The text was updated successfully, but these errors were encountered: