-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Description
Silence of the Launchpad on errors
Steps to reproduce
on GitLens v17.3.0
- Connect GitHub and GitLab on GKDev
- Sync integrations in GitLens
- Go to GitLab OAuth settings (or Azure) and reject the application (keep it connected on GKDev)
- for GitLab it stops working immediately, for Azure wait for 30min until the azure token expires
- Open the launchpad
Expected result
You see GitHub PRs
Actual result
You fail seeing any PRs, because of GitLab error:
In the sidebar Launchpad View:

Related issues:
Technical details
It feels like it's here:
vscode-gitlens/src/plus/integrations/integrationService.ts
Lines 716 to 756 in 6dfa541
| private async getMyPullRequestsCore( | |
| integrations: Map<GitHostIntegration, ResourceDescriptor[] | undefined>, | |
| cancellation?: CancellationToken, | |
| silent?: boolean, | |
| ): Promise<IntegrationResult<PullRequest[] | undefined>> { | |
| const start = Date.now(); | |
| const promises: Promise<IntegrationResult<PullRequest[] | undefined>>[] = []; | |
| for (const [integration, repos] of integrations) { | |
| if (integration == null) continue; | |
| promises.push(integration.searchMyPullRequests(repos, cancellation, silent)); | |
| } | |
| const results = await Promise.allSettled(promises); | |
| const errors = [ | |
| ...filterMap(results, r => | |
| r.status === 'fulfilled' && r.value?.error != null ? r.value.error : undefined, | |
| ), | |
| ]; | |
| if (errors.length) { | |
| return { | |
| error: errors.length === 1 ? errors[0] : new AggregateError(errors), | |
| duration: Date.now() - start, | |
| }; | |
| } | |
| return { | |
| value: [ | |
| ...flatten( | |
| filterMap(results, r => | |
| r.status === 'fulfilled' && r.value != null && r.value?.error == null | |
| ? r.value.value | |
| : undefined, | |
| ), | |
| ), | |
| ], | |
| duration: Date.now() - start, | |
| }; | |
| } |
Maybe we should not fail the whole procedure if one of integrations fails?
Solution
✅ Launchpad. Some integrations failed:

✅ Let user navigate to the GitLens logs to investigate the problem or have material to contact the support:

✅ Launchpad.All integrations failed:

✅ Launchpad View. All integration failed:

✅ Launchpad View. One integration failed:

✅ Tooltips motivate user for action to fix the error:
Multiple errors case
- It is possible that user has multiple integrations and multiple fail
- and an integration can give a non-auth error, such as
500,429, etc.
What error do we show?
The idea is to show only one error in order to avoid cluttering the Launchpad with multiple error items.
- We look through the list of errors trying to find an Authentication error. If we find one we show it. User can get rid of it by re-connecting/disconnecting
- If there is no Authentication errors in the list, then we just take the first one.


