mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
Only Run Migrations in True Background (#8548)
* Only Run Migrations in True Background * Use `isPrivateMode` * Use `popupOnlyContext`
This commit is contained in:
@@ -1095,7 +1095,8 @@ export default class MainBackground {
|
|||||||
async bootstrap() {
|
async bootstrap() {
|
||||||
this.containerService.attachToGlobal(self);
|
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
|
// This is here instead of in in the InitService b/c we don't plan for
|
||||||
// side effects to run in the Browser InitService.
|
// side effects to run in the Browser InitService.
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export class InitService {
|
|||||||
|
|
||||||
init() {
|
init() {
|
||||||
return async () => {
|
return async () => {
|
||||||
await this.stateService.init();
|
await this.stateService.init({ runMigrations: false }); // Browser background is responsible for migrations
|
||||||
await this.i18nService.init();
|
await this.i18nService.init();
|
||||||
|
|
||||||
if (!BrowserPopupUtils.inPopup(window)) {
|
if (!BrowserPopupUtils.inPopup(window)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user