From df58df88958c78515b25dbfbbc71f0787d3255dc Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Fri, 21 Jul 2023 11:10:28 -0700 Subject: [PATCH] Only fire once (#188523) Fixes https://github.com/microsoft/vscode/issues/188460 --- src/vs/platform/secrets/common/secrets.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/vs/platform/secrets/common/secrets.ts b/src/vs/platform/secrets/common/secrets.ts index 6c6b822ebc2..4f9b9a49f9f 100644 --- a/src/vs/platform/secrets/common/secrets.ts +++ b/src/vs/platform/secrets/common/secrets.ts @@ -128,7 +128,14 @@ export abstract class BaseSecretStorageService implements ISecretStorageService } this._onDidChangeValueDisposable?.dispose(); - this._onDidChangeValueDisposable = storageService.onDidChangeValue(e => this.onDidChangeValue(e.key)); + this._onDidChangeValueDisposable = storageService.onDidChangeValue(e => { + // We only care about changes to the application scope since SecretStorage + // only stores secrets in the application scope but this seems to fire + // 2 events. Once for APP scope and once for PROFILE scope. ref #188460 + if (e.scope === StorageScope.APPLICATION) { + this.onDidChangeValue(e.key); + } + }); return storageService; }