Ver a proveniência

Fixes #1936 promise cycle when validating access

main
Eric Amodio há 2 anos
ascendente
cometimento
8fb535055b
2 ficheiros alterados com 5 adições e 2 eliminações
  1. +1
    -0
      CHANGELOG.md
  2. +4
    -2
      src/git/gitProviderService.ts

+ 1
- 0
CHANGELOG.md Ver ficheiro

@ -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 Ver ficheiro

@ -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> {

Carregando…
Cancelar
Guardar