question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python API triggers add events even after refresh promise has resolved

See original GitHub issue

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 the refreshEnvironments promise resolves. Similarly I would not expect any changes to known 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.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
DonJayamannecommented, Nov 14, 2022

Damn, sorry, you are right, I can no longer repro this issue, must have been doing something wrong at my end. Apologies for creating this issue.

0reactions
karrtikrcommented, Nov 14, 2022

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.

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Handle Async Data Loading, Lazy Loading, and Code ...
Inside the promise, add a setTimeout function that will resolve the promise after 1500 milliseconds. This will give you some time to see...
Read more >
How to wait for JavaScript to finish in playwright - Stack Overflow
My code find an input element that can sometimes be a drop down, sometimes a text and sometimes a date. To handle this...
Read more >
How to Fix the Refresh Button When Using Service Workers
Approach #2: Refresh old tabs when a new Service Worker is installed. This is just a slight tweak on the previous approach. navigator....
Read more >
Realtime Database triggers | Cloud Functions for Firebase
Functions let you handle Realtime Database events at two levels of specificity; you can listen for specifically for only creation, update, or deletion...
Read more >
The 10 Most Common JavaScript Issues Developers Face
The reason you get the above error is because, when you invoke ... though, this is not the case and the variable i...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found