mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 10:43:35 +00:00
Correct and test changeover point for userId source in storage migration (#8990)
This commit is contained in:
@@ -51,17 +51,13 @@ const rollbackJson = () => {
|
||||
},
|
||||
global_account_accounts: {
|
||||
user1: {
|
||||
profile: {
|
||||
email: "user1",
|
||||
name: "User 1",
|
||||
emailVerified: true,
|
||||
},
|
||||
email: "user1",
|
||||
name: "User 1",
|
||||
emailVerified: true,
|
||||
},
|
||||
user2: {
|
||||
profile: {
|
||||
email: "",
|
||||
emailVerified: false,
|
||||
},
|
||||
email: "",
|
||||
emailVerified: false,
|
||||
},
|
||||
},
|
||||
global_account_activeAccountId: "user1",
|
||||
|
||||
@@ -38,8 +38,8 @@ export class KnownAccountsMigrator extends Migrator<59, 60> {
|
||||
}
|
||||
async rollback(helper: MigrationHelper): Promise<void> {
|
||||
// authenticated account are removed, but the accounts record also contains logged out accounts. Best we can do is to add them all back
|
||||
const accounts = (await helper.getFromGlobal<Record<string, unknown>>(ACCOUNT_ACCOUNTS)) ?? {};
|
||||
await helper.set("authenticatedAccounts", Object.keys(accounts));
|
||||
const userIds = (await helper.getKnownUserIds()) ?? [];
|
||||
await helper.set("authenticatedAccounts", userIds);
|
||||
await helper.removeFromGlobal(ACCOUNT_ACCOUNTS);
|
||||
|
||||
// Active Account Id
|
||||
|
||||
Reference in New Issue
Block a user