Sfoglia il codice sorgente

Fixes #1936 promise cycle when validating access

main
Eric Amodio 2 anni fa
parent
commit
8fb535055b
2 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. +1
    -0
      CHANGELOG.md
  2. +4
    -2
      src/git/gitProviderService.ts

+ 1
- 0
CHANGELOG.md Vedi File

@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## Fixed
- Fixes [#1936](https://github.com/gitkraken/vscode-gitlens/issues/1936) - Broken repositories view
- Fixes [#1882](https://github.com/gitkraken/vscode-gitlens/issues/1882) - Blame annotations not showing anymore after update
- Fixes [#1787](https://github.com/gitkraken/vscode-gitlens/issues/1787) - Remove '-review' from Gerrit Remote reviewDomain() — thanks to [PR #1954](https://github.com/gitkraken/vscode-gitlens/pull/1954) by Felipe Santos ([@felipecrs](https://github.com/felipecrs))
- Fixes [#1902](https://github.com/gitkraken/vscode-gitlens/issues/1902) - Support replacing mirror/replica domain with main domain for remote provider — thanks to [PR #1954](https://github.com/gitkraken/vscode-gitlens/pull/1954) by Felipe Santos ([@felipecrs](https://github.com/felipecrs))

+ 4
- 2
src/git/gitProviderService.ts Vedi File

@ -564,10 +564,11 @@ export class GitProviderService implements Disposable {
this: GitProviderService,
repoPath: string | Uri,
plan: FreeSubscriptionPlans,
force: boolean = false,
): Promise<FeatureAccess> {
const { path: cacheKey } = this.getProvider(repoPath);
let access = this._accessCache.get(cacheKey);
let access = force ? undefined : this._accessCache.get(cacheKey);
if (access == null) {
access = this.visibility(repoPath).then(visibility => {
if (visibility !== RepositoryVisibility.Private) {
@ -628,7 +629,8 @@ export class GitProviderService implements Disposable {
: { allowed: false, subscription: { current: subscription, required: requiredPlan } };
}
return getRepoAccess.call(this, repoPath, plan);
// Pass force = true to bypass the cache and avoid a promise loop (where we used the cached promise we just created to try to resolve itself 🤦)
return getRepoAccess.call(this, repoPath, plan, true);
}
async ensureAccess(feature: PlusFeatures, repoPath?: string): Promise<void> {

Caricamento…
Annulla
Salva