diff --git a/libs/common/src/state-migrations/migrations/62-migrate-vault-timeout-settings-svc-to-state-provider.spec.ts b/libs/common/src/state-migrations/migrations/62-migrate-vault-timeout-settings-svc-to-state-provider.spec.ts index 1a736c1623..aa715c3c06 100644 --- a/libs/common/src/state-migrations/migrations/62-migrate-vault-timeout-settings-svc-to-state-provider.spec.ts +++ b/libs/common/src/state-migrations/migrations/62-migrate-vault-timeout-settings-svc-to-state-provider.spec.ts @@ -13,6 +13,10 @@ import { // Represents data in state service pre-migration function preMigrationJson() { return { + // desktop only global data format + "global.vaultTimeout": -1, + "global.vaultTimeoutAction": "lock", + global: { vaultTimeout: 30, vaultTimeoutAction: "lock", @@ -267,6 +271,10 @@ describe("VaultTimeoutSettingsServiceStateProviderMigrator", () => { otherStuff: "otherStuff", }); + // Expect we removed desktop specially formatted global data + expect(helper.remove).toHaveBeenCalledWith("global\\.vaultTimeout"); + expect(helper.remove).toHaveBeenCalledWith("global\\.vaultTimeoutAction"); + // User data expect(helper.set).toHaveBeenCalledWith("user1", { settings: { diff --git a/libs/common/src/state-migrations/migrations/62-migrate-vault-timeout-settings-svc-to-state-provider.ts b/libs/common/src/state-migrations/migrations/62-migrate-vault-timeout-settings-svc-to-state-provider.ts index ee9ee4c9ea..7451fd3751 100644 --- a/libs/common/src/state-migrations/migrations/62-migrate-vault-timeout-settings-svc-to-state-provider.ts +++ b/libs/common/src/state-migrations/migrations/62-migrate-vault-timeout-settings-svc-to-state-provider.ts @@ -122,10 +122,15 @@ export class VaultTimeoutSettingsServiceStateProviderMigrator extends Migrator<6 await Promise.all([...accounts.map(({ userId, account }) => migrateAccount(userId, account))]); - // Delete global data + // Delete global data (works for browser extension and web; CLI doesn't have these as global settings). delete globalData?.vaultTimeout; delete globalData?.vaultTimeoutAction; await helper.set("global", globalData); + + // Remove desktop only settings. These aren't found by the above global key removal b/c of + // the different storage key format. This removal does not cause any issues on migrating for other clients. + await helper.remove("global\\.vaultTimeout"); + await helper.remove("global\\.vaultTimeoutAction"); } async rollback(helper: MigrationHelper): Promise {