1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

[PM-19287] Feature flag for encrypt service (#13894)

* Extract getFeatureFlagValue to pure function

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* Add broadcasting abstractions and OnServerConfigChange interface.

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* Add implementation of onServerConfigChange on encrypt services

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* Add onServerConfigChange implementation for encrypt worker

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* Wire up broadcasting in dependency injection

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* Add unit tests

* Handle subscribing for onServerConfigChange in init services

---------

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
This commit is contained in:
Thomas Avery
2025-04-01 14:14:00 -05:00
committed by GitHub
parent fa0a7af8ed
commit 17f661e3d1
20 changed files with 722 additions and 58 deletions

View File

@@ -1309,6 +1309,13 @@ export default class MainBackground {
// Only the "true" background should run migrations
await this.stateService.init({ runMigrations: true });
this.configService.serverConfig$.subscribe((newConfig) => {
if (newConfig != null) {
this.encryptService.onServerConfigChange(newConfig);
this.bulkEncryptService.onServerConfigChange(newConfig);
}
});
// This is here instead of in in the InitService b/c we don't plan for
// side effects to run in the Browser InitService.
const accounts = await firstValueFrom(this.accountService.accounts$);