1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-04 09:01:01 +01:00

Only Run Migrations in True Background (#8548)

* Only Run Migrations in True Background

* Use `isPrivateMode`

* Use `popupOnlyContext`
This commit is contained in:
Justin Baur 2024-04-24 11:14:53 -04:00 committed by GitHub
parent 423d8c71b5
commit 493b79b888
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -1095,7 +1095,8 @@ export default class MainBackground {
async bootstrap() {
this.containerService.attachToGlobal(self);
await this.stateService.init({ runMigrations: !this.isPrivateMode });
// Only the "true" background should run migrations
await this.stateService.init({ runMigrations: !this.popupOnlyContext });
// This is here instead of in in the InitService b/c we don't plan for
// side effects to run in the Browser InitService.

View File

@ -22,7 +22,7 @@ export class InitService {
init() {
return async () => {
await this.stateService.init();
await this.stateService.init({ runMigrations: false }); // Browser background is responsible for migrations
await this.i18nService.init();
if (!BrowserPopupUtils.inPopup(window)) {