Skip to content

Commit c6033ea

Browse files
Restore previous behavior of onDidChangeSecret (microsoft#187333)
ref microsoft#187247
1 parent 44d1d6a commit c6033ea

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

src/vs/platform/secrets/common/secrets.ts

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { SequencerByKey } from 'vs/base/common/async';
77
import { IEncryptionService } from 'vs/platform/encryption/common/encryptionService';
88
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
99
import { IStorageService, InMemoryStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
10-
import { Event, PauseableEmitter } from 'vs/base/common/event';
10+
import { Emitter, Event } from 'vs/base/common/event';
1111
import { ILogService } from 'vs/platform/log/common/log';
1212
import { IDisposable } from 'vs/base/common/lifecycle';
1313

@@ -30,7 +30,7 @@ export abstract class BaseSecretStorageService implements ISecretStorageService
3030

3131
private _storagePrefix = 'secret://';
3232

33-
private readonly _onDidChangeSecret = new PauseableEmitter<string>();
33+
private readonly _onDidChangeSecret = new Emitter<string>();
3434
onDidChangeSecret: Event<string> = this._onDidChangeSecret.event;
3535

3636
protected readonly _sequencer = new SequencerByKey<string>();
@@ -55,11 +55,6 @@ export abstract class BaseSecretStorageService implements ISecretStorageService
5555
return;
5656
}
5757

58-
if (this._onDidChangeSecret.isPaused) {
59-
this._logService.trace(`[SecretStorageService] Skipping change event for secret: ${key} because it is paused`);
60-
return;
61-
}
62-
6358
const secretKey = key.slice(this._storagePrefix.length);
6459

6560
this._logService.trace(`[SecretStorageService] Notifying change in value for secret: ${secretKey}`);
@@ -104,13 +99,8 @@ export abstract class BaseSecretStorageService implements ISecretStorageService
10499
throw e;
105100
}
106101
const fullKey = this.getKey(key);
107-
try {
108-
this._onDidChangeSecret.pause();
109-
this._logService.trace('[secrets] storing encrypted secret for key:', fullKey);
110-
storageService.store(fullKey, encrypted, StorageScope.APPLICATION, StorageTarget.MACHINE);
111-
} finally {
112-
this._onDidChangeSecret.resume();
113-
}
102+
this._logService.trace('[secrets] storing encrypted secret for key:', fullKey);
103+
storageService.store(fullKey, encrypted, StorageScope.APPLICATION, StorageTarget.MACHINE);
114104
this._logService.trace('[secrets] stored encrypted secret for key:', fullKey);
115105
});
116106
}
@@ -120,13 +110,8 @@ export abstract class BaseSecretStorageService implements ISecretStorageService
120110
const storageService = await this.resolvedStorageService;
121111

122112
const fullKey = this.getKey(key);
123-
try {
124-
this._onDidChangeSecret.pause();
125-
this._logService.trace('[secrets] deleting secret for key:', fullKey);
126-
storageService.remove(fullKey, StorageScope.APPLICATION);
127-
} finally {
128-
this._onDidChangeSecret.resume();
129-
}
113+
this._logService.trace('[secrets] deleting secret for key:', fullKey);
114+
storageService.remove(fullKey, StorageScope.APPLICATION);
130115
this._logService.trace('[secrets] deleted secret for key:', fullKey);
131116
});
132117
}

0 commit comments

Comments
 (0)