-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Extension: Getting config setting after waiting for update doesn't provide updated value #25508
Comments
From the extension host we call |
I think this is the case always.. Configuration editing service was queuing always (AFIK) and never waited for event to trigger. Its the same behaviour for core and extensions. Everybody listens to onConfigurationChange event for any changes to configurations. Definitely, editing service can be improved to resolve after configuration is updated both on disk and in memory. So not sure if is a candidate for end game. |
I could certainly be mistaken, but I thought at one point (quite a while ago), I would get the event before the promise resolved (which would be ideal imo) -- or at least I have some recollection of having to change my code to deal with that (though it could have just been a bug I didn't notice before). But I'm pretty sure that I used to be able to query for the value after waiting for the update to get the most recent value (even without the event firing). And without this guarantee it makes the code an extension needs to write to wait, very error prone, since if you need to wait for the event it gets challenging -- since you aren't guaranteed to get the event (depending on what you are updating). This cause me to need to write ugly code like: https://github.com/eamodio/vscode-toggle-excluded-files/blob/master/src/excludeController.ts#L154 I believe this is also causing some intermittent timing issues I am seeing in GitLens as well |
Yes, it should fire the event and update the state before the promise resolves. We try to figure when that got lost... |
Sorry guys.. It was working before and it was broken by me in 1.11. Here is the change that caused this - 4c2600f |
Still seeing this |
Works now |
I actually fixed it in configuration editing service to reload configuration after editing. Reload configuration should trigger change event. Global configuration is triggering but workspace configurations is not. Refactorings from very long back (1.4) changed the behaviour of workspace configuration service. It is not triggering change event anymore. Fixed workspace configuration to trigger event in reload. |
Steps to Reproduce:
//cc @jrieken
The text was updated successfully, but these errors were encountered: