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

Never run cleared auxwindow timeouts #221296

Merged
merged 2 commits into from
Jul 29, 2024
Merged

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
6 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants