Skip to content

Bad credential of one integration ruins other integrations on Launchpad #4492

@sergeibbb

Description

@sergeibbb

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)
Image
  • 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 quickpick Launchpad:
Image

In the sidebar Launchpad View:
Image

Related issues:

Technical details

It feels like it's here:

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:
Image

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

✅ Launchpad.All integrations failed:
Image

✅ Launchpad View. All integration failed:
Image

✅ Launchpad View. One integration failed:
Image

✅ Tooltips motivate user for action to fix the error:

quickpick Launchpad:
Image

sidebar Launchpad View:
Image

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.

  1. 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
  2. If there is no Authentication errors in the list, then we just take the first one.

Follow-ups

Metadata

Metadata

Assignees

Labels

area-launchpadIssues or features related to Launchpad

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions