Never run cleared auxwindow timeouts #221296
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The timeout attached to the aux-window is not always cleared even after calling
clearTimeout
.This PR introduces a very simple fix that ensures that if
clearTimeout
has been called, then the handler associated with the timeout is never run.Background
When the user has at least one aux-window open, we attach any timeout to all windows to ensure that it runs. This means that we also need to clear the timeout from all windows. Unfortunately, it seems that in some circumstances, the timeout is not cleared from the aux window (while it is cleared from the main window), despite
vscodeOriginalClearTimeout
being called on the aux window. This causes a timeout that the calling code thought was cleared to still be called, which can result in bugs.The proposed fix should have no negative consequences, and ensures that even if Electron is behaving in confusing ways, a cleared timeout will not run.