-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Python API triggers add events even after refresh promise has resolved #20216
Comments
@karrtikr we need to know when all envs have been discovered and completed so we can have a progress indicator in the kernel quickpick (this is the quick pick sample I shared with you). Bugs
|
I suspect the timings to be very close even if events are fired later. Please make sure you're not using any asynchronous callbacks while verifying. |
This doesn't make sense, are you saying that the current code does have the potential to trigger events after the refresh finishes?
We do have a lot of async code, not sure how that would affect this. With async code the event loop should still handle the callbacks and the resolution of the promise in order. |
Damn, sorry, you are right, I can no longer repro this issue, must have been doing something wrong at my end. |
Each loop starts in order but can yield control in between if callback itself is async, so finish order is not guaranteed. Anyways glad you were able to verify its okay. |
Jupyter extension invokes the
refreshEnvironments
API method.However even after this promise resolves, we get events being triggered for
onDidChangeEnvironments
.Meaning the discovery has not been completed.
I.e. once
refreshEnvironments
, then this means all discovery has been completed, however events being triggered means this is still in progress.I would not expect any more events to be triggered for
onDidChangeEnvironments
after therefreshEnvironments
promise resolves. Similarly I would not expect any changes toknown
after this refresh promise.Exceptions include users creating/removing python environments, however when it comes to
refresh
the expectation is that this promise should resolve after everything has been completed.The text was updated successfully, but these errors were encountered: