Skip to content

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

@abarsov

Description

@abarsov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions