vscode-gitlens
vscode-gitlens copied to clipboard
Stop hanging setupMCP on unclosed information message dialog
Description
This precedes #4626
The Problem
Steps to reproduce
- call "GitLens: Re-install GitKraken MCP" command in the palette.
- Check that it enters
setupMCPfunction. -
Setting up the GitKraken MCPnotification appears. Then it's changed by a success message. - Do not touch the notification message that appears after the installation.
- One more time call "GitLens: Re-install GitKraken MCP" command in the palette.
Expected result
-
setupMCPis called one more time (you can check it in debugger or logs) -
Setting up the GitKraken MCPnotification appears again.
Actual result ⚠️
- it never enter
setupMCPagain ⚠️ - you do not see the
Setting up the GitKraken MCPnotification.
Explanation
setupMCP() method is gated by @gate annotation that does not let to re-call unfinished promises.
The execution has been waiting for user interaction with the success message, therefore the setupMCP() execution has never been resolved, so the @gate have never been released. That prevented MCP installation from another attempt.
Solution
I wrap the information message prompt in an async wrapper that is not awaited, to avoid blocking the main execution flow. This ensures the gated setupMCP function always finished even if user does not interact with the information message.
Checklist
- [x] I have followed the guidelines in the Contributing document
- [x] My changes follow the coding style of this project
- [x] My changes build without any errors or warnings
- [x] My changes have been formatted and linted
- [x] My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
- [x] My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
- [x] My changes have a descriptive commit message with a short title, including a
Fixes $XXX -orCloses #XXX -prefix to auto-close the issue that your PR addresses
Hi @eamodio , @axosoft-ramint
Do you think this fix makes sense?