Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find in page dialog fails to open after it was just closed (due to race condition) #15

Open
abarsov opened this issue Sep 10, 2020 · 1 comment

Comments

@abarsov
Copy link

abarsov commented Sep 10, 2020

Steps to reproduce:

  1. Click Cmd+F (dialog is opened with help of FindInPath.openFindWindow())
  2. Press X-button to close the dialog ( FindInPath.closeFindWindow())
  3. Immediately after that press Cmd+F again

Actual result: dialog is not shown and it is not shown on all subsequent Cmd+F

Details on race condition:

  • on step 2 FindInPath.closeFindWindow() set this[hasOpened] = false
  • then closeFindWindow shedule move and return
  • on step 3 FindInPath.openFindWindow() start executing, it check that this[hasOpened] is false, schedule move of the dialog to the appropriate position and change this[hasOpened] = true
  • move promise scheduled by closeFindWindow exectutes and move dialog to invisible position
  • move promise scheduled by openFindWindow exectutes and move dialog to visible position
  • visibility is set to visible by timeout function from openFindWindow
  • then promise scheduled after move in closeFindWindow reset visibility to hidden

This way we have dailog element in appropriate position, but it is invisible and this[hasOpened] is true

@abarsov abarsov changed the title Find in path window is not opened after it was just closed (due to race condition) Find in path dialog is not opened after it was just closed (due to race condition) Sep 10, 2020
@abarsov abarsov changed the title Find in path dialog is not opened after it was just closed (due to race condition) Find in path dialog fails to open after it was just closed (due to race condition) Sep 10, 2020
@abarsov
Copy link
Author

abarsov commented Sep 10, 2020

I have authored pull requst with the fix: #16

@abarsov abarsov changed the title Find in path dialog fails to open after it was just closed (due to race condition) Find in page dialog fails to open after it was just closed (due to race condition) Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant