Skip to content

Conversation

@arvid220u
Copy link
Contributor

@arvid220u arvid220u commented Jul 9, 2024

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.

@bpasero bpasero added this to the August 2024 milestone Jul 27, 2024
@bpasero
Copy link
Member

bpasero commented Jul 27, 2024

Thanks, I am still curious why clearTimeout would not be triggered though.

cc @deepak1556

@bpasero bpasero merged commit 5cebe61 into microsoft:main Jul 29, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

4 participants