MCPcopy Create free account
hub / github.com/bytebase/bytebase / migratePrefixKeys

Function migratePrefixKeys

frontend/src/utils/storage-migrate.ts:75–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73}
74
75function migratePrefixKeys() {
76 for (const [oldPrefix, newPrefix] of PREFIX_RENAMES) {
77 const keysToMigrate: [string, string][] = [];
78 for (let i = 0; i < localStorage.length; i++) {
79 const key = localStorage.key(i);
80 if (key?.startsWith(oldPrefix)) {
81 const suffix = key.slice(oldPrefix.length);
82 keysToMigrate.push([key, `${newPrefix}${suffix}`]);
83 }
84 }
85 for (const [oldKey, newKey] of keysToMigrate) {
86 moveKey(oldKey, newKey);
87 }
88 }
89}
90
91function migrateUIScopeKeys() {
92 // Old UI state keys used different prefixes scoped by email:

Callers 1

migrateStorageKeysFunction · 0.85

Calls 2

moveKeyFunction · 0.85
keyMethod · 0.45

Tested by

no test coverage detected