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

Fix file browser opening race condition #23867

Merged
merged 1 commit into from Jul 13, 2023

Conversation

Charles-Gagnon
Copy link
Contributor

@Charles-Gagnon Charles-Gagnon commented Jul 13, 2023

For #23832

This dialog is set up so that when the filter option is changed it fires an event to tell the provider to refresh the tree. But STS expects that this only happens AFTER the initial open event is sent so it initializes properly. And there was a race condition here where the select box event firing could happen before this initial event was actually completed.

So to fix this we send the initialize event before actually setting the filter box contents - this ensures the message is sent before we get the filter notification.

A slightly better solution would probably be to refactor this to be completely async and keep track of whether the initialize event has been sent before sending the filter event - but that's beyond the scope of the fix for July so just going with the simpler fix for now.

Note - it's unclear why this only seems to be showing up now. I didn't see any changes that would explain this. But race conditions are weird like that - so maybe a node update or something changed things enough that this would show up more often.

@Charles-Gagnon Charles-Gagnon merged commit 4ba2c6c into main Jul 13, 2023
8 of 9 checks passed
@Charles-Gagnon Charles-Gagnon deleted the chgagnon/fixFileBrowserRace branch July 13, 2023 22:35
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

Successfully merging this pull request may close these issues.

None yet

2 participants