mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +00:00
PM-3585 Improve state migrations (#5009)
* WIP: safer state migrations Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com> * Add min version check and remove old migrations Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com> * Add rollback and version checking * Add state version move migration * Expand tests and improve typing for Migrations * Remove StateMigration Service * Rewrite version 5 and 6 migrations * Add all but initial migration to supported migrations * Handle stateVersion location in migrator update versions * Move to unique migrations directory * Disallow imports outside of state-migrations * Lint and test fixes * Do not run migrations if we cannot determine state * Fix desktop background StateService build * Document Migration builder class * Add debug logging to migrations * Comment on migrator overrides * Use specific property names * `npm run prettier` 🤖 * Insert new migration * Set stateVersion when creating new globals object * PR comments * Fix migrate imports * Move migration building into `migrate` function * Export current version from migration definitions * Move file version concerns to migrator * Update migrate spec to reflect new version requirements * Fix import paths * Prefer unique state data * Remove unnecessary async * Prefer to not use `any` --------- Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com> Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
This commit is contained in:
@@ -18,7 +18,6 @@ export * from "./notification-type.enum";
|
||||
export * from "./product-type.enum";
|
||||
export * from "./provider-type.enum";
|
||||
export * from "./secure-note-type.enum";
|
||||
export * from "./state-version.enum";
|
||||
export * from "./storage-location.enum";
|
||||
export * from "./theme-type.enum";
|
||||
export * from "./uri-match-type.enum";
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
export enum StateVersion {
|
||||
One = 1, // Original flat key/value pair store
|
||||
Two = 2, // Move to a typed State object
|
||||
Three = 3, // Fix migration of users' premium status
|
||||
Four = 4, // Fix 'Never Lock' option by removing stale data
|
||||
Five = 5, // Migrate to new storage of encrypted organization keys
|
||||
Six = 6, // Delete account.keys.legacyEtmKey property
|
||||
Seven = 7, // Remove global desktop auto prompt setting, move to account
|
||||
Latest = Seven,
|
||||
}
|
||||
Reference in New Issue
Block a user