-
Notifications
You must be signed in to change notification settings - Fork 350
Fix kernel picker UI stuck in loading state when third-party extensions throw CancellationError #16952
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
Conversation
Co-authored-by: DonJayamanne <[email protected]>
Co-authored-by: DonJayamanne <[email protected]>
DonJayamanne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot I don't think the changes are valid, please review my comments and your changes
src/notebooks/controllers/kernelSource/remoteNotebookKernelSourceSelector.ts
Outdated
Show resolved
Hide resolved
DonJayamanne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot address my comments
…finally block Co-authored-by: DonJayamanne <[email protected]>
I've reviewed and addressed your feedback. The original try-catch approach was indeed invalid because both branches performed identical actions. The correct fix was to ensure the UI busy state gets reset in the Fixed in commit d99716c with the proper approach. |
You're absolutely right about the redundant try-catch block in commit 79fbf67. I've already addressed this issue in commit d99716c by:
This ensures the UI busy state is always reset when CancellationError is thrown by third-party extensions, while keeping the code clean and purposeful. |
The kernel picker was not properly handling
CancellationErrorexceptions thrown by third-party extensions'JupyterServerCommandProvider.handleCommand()implementations, causing the UI to remain stuck in a loading state instead of dismissing as documented in the API.Problem
According to the Extension API documentation, when third-party extensions want to dismiss the kernel picker UI (e.g., when users hit ESC or close their custom dialogs), they should throw a
CancellationErrorfrom theirhandleCommandmethod. However, this wasn't working correctly - the picker would stay in a pending/loading state instead of dismissing.The API docs clearly state:
Root Cause
The issue was in the caller's error handling in
RemoteNotebookKernelSourceSelector. When any exception (includingCancellationError) was thrown fromselectRemoteServerFromRemoteKernelFinder(), thelazyQuickPick.busy = falsestatement was only executed on success, leaving the UI in a perpetual loading state when errors occurred.Solution
Moved the
lazyQuickPick.busy = falsestatement from the success path to thefinallyblock:This ensures that:
CancellationErrorCancellationErrorstill bubbles up correctly to dismiss the pickerTesting
Fixes #16469.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.