|
@ -39,7 +39,6 @@ import { |
|
|
generateUpdateStatement, |
|
|
generateUpdateStatement, |
|
|
generateInsertStatement, |
|
|
generateInsertStatement, |
|
|
} from "../db/databaseUtil"; |
|
|
} from "../db/databaseUtil"; |
|
|
import { updateDefaultSettings } from "../db/databaseUtil"; |
|
|
|
|
|
import { importFromMnemonic } from "../libs/util"; |
|
|
import { importFromMnemonic } from "../libs/util"; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -156,11 +155,14 @@ export async function getDexieContacts(): Promise<Contact[]> { |
|
|
await db.open(); |
|
|
await db.open(); |
|
|
const contacts = await db.contacts.toArray(); |
|
|
const contacts = await db.contacts.toArray(); |
|
|
logger.info( |
|
|
logger.info( |
|
|
`[MigrationService] Retrieved ${contacts.length} contacts from Dexie`, |
|
|
`[IndexedDBMigrationService] Retrieved ${contacts.length} contacts from Dexie`, |
|
|
); |
|
|
); |
|
|
return contacts; |
|
|
return contacts; |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
logger.error("[MigrationService] Error retrieving Dexie contacts:", error); |
|
|
logger.error( |
|
|
|
|
|
"[IndexedDBMigrationService] Error retrieving Dexie contacts:", |
|
|
|
|
|
error, |
|
|
|
|
|
); |
|
|
throw new Error(`Failed to retrieve Dexie contacts: ${error}`); |
|
|
throw new Error(`Failed to retrieve Dexie contacts: ${error}`); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -214,11 +216,14 @@ export async function getSqliteContacts(): Promise<Contact[]> { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
logger.info( |
|
|
logger.info( |
|
|
`[MigrationService] Retrieved ${contacts.length} contacts from SQLite`, |
|
|
`[IndexedDBMigrationService] Retrieved ${contacts.length} contacts from SQLite`, |
|
|
); |
|
|
); |
|
|
return contacts; |
|
|
return contacts; |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
logger.error("[MigrationService] Error retrieving SQLite contacts:", error); |
|
|
logger.error( |
|
|
|
|
|
"[IndexedDBMigrationService] Error retrieving SQLite contacts:", |
|
|
|
|
|
error, |
|
|
|
|
|
); |
|
|
throw new Error(`Failed to retrieve SQLite contacts: ${error}`); |
|
|
throw new Error(`Failed to retrieve SQLite contacts: ${error}`); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -251,11 +256,14 @@ export async function getDexieSettings(): Promise<Settings[]> { |
|
|
await db.open(); |
|
|
await db.open(); |
|
|
const settings = await db.settings.toArray(); |
|
|
const settings = await db.settings.toArray(); |
|
|
logger.info( |
|
|
logger.info( |
|
|
`[MigrationService] Retrieved ${settings.length} settings from Dexie`, |
|
|
`[IndexedDBMigrationService] Retrieved ${settings.length} settings from Dexie`, |
|
|
); |
|
|
); |
|
|
return settings; |
|
|
return settings; |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
logger.error("[MigrationService] Error retrieving Dexie settings:", error); |
|
|
logger.error( |
|
|
|
|
|
"[IndexedDBMigrationService] Error retrieving Dexie settings:", |
|
|
|
|
|
error, |
|
|
|
|
|
); |
|
|
throw new Error(`Failed to retrieve Dexie settings: ${error}`); |
|
|
throw new Error(`Failed to retrieve Dexie settings: ${error}`); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -309,11 +317,14 @@ export async function getSqliteSettings(): Promise<Settings[]> { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
logger.info( |
|
|
logger.info( |
|
|
`[MigrationService] Retrieved ${settings.length} settings from SQLite`, |
|
|
`[IndexedDBMigrationService] Retrieved ${settings.length} settings from SQLite`, |
|
|
); |
|
|
); |
|
|
return settings; |
|
|
return settings; |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
logger.error("[MigrationService] Error retrieving SQLite settings:", error); |
|
|
logger.error( |
|
|
|
|
|
"[IndexedDBMigrationService] Error retrieving SQLite settings:", |
|
|
|
|
|
error, |
|
|
|
|
|
); |
|
|
throw new Error(`Failed to retrieve SQLite settings: ${error}`); |
|
|
throw new Error(`Failed to retrieve SQLite settings: ${error}`); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -353,11 +364,14 @@ export async function getSqliteAccounts(): Promise<string[]> { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
logger.info( |
|
|
logger.info( |
|
|
`[MigrationService] Retrieved ${dids.length} accounts from SQLite`, |
|
|
`[IndexedDBMigrationService] Retrieved ${dids.length} accounts from SQLite`, |
|
|
); |
|
|
); |
|
|
return dids; |
|
|
return dids; |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
logger.error("[MigrationService] Error retrieving SQLite accounts:", error); |
|
|
logger.error( |
|
|
|
|
|
"[IndexedDBMigrationService] Error retrieving SQLite accounts:", |
|
|
|
|
|
error, |
|
|
|
|
|
); |
|
|
throw new Error(`Failed to retrieve SQLite accounts: ${error}`); |
|
|
throw new Error(`Failed to retrieve SQLite accounts: ${error}`); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -391,11 +405,14 @@ export async function getDexieAccounts(): Promise<Account[]> { |
|
|
await accountsDB.open(); |
|
|
await accountsDB.open(); |
|
|
const accounts = await accountsDB.accounts.toArray(); |
|
|
const accounts = await accountsDB.accounts.toArray(); |
|
|
logger.info( |
|
|
logger.info( |
|
|
`[MigrationService] Retrieved ${accounts.length} accounts from Dexie`, |
|
|
`[IndexedDBMigrationService] Retrieved ${accounts.length} accounts from Dexie`, |
|
|
); |
|
|
); |
|
|
return accounts; |
|
|
return accounts; |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
logger.error("[MigrationService] Error retrieving Dexie accounts:", error); |
|
|
logger.error( |
|
|
|
|
|
"[IndexedDBMigrationService] Error retrieving Dexie accounts:", |
|
|
|
|
|
error, |
|
|
|
|
|
); |
|
|
throw new Error(`Failed to retrieve Dexie accounts: ${error}`); |
|
|
throw new Error(`Failed to retrieve Dexie accounts: ${error}`); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -429,7 +446,7 @@ export async function getDexieAccounts(): Promise<Account[]> { |
|
|
* ``` |
|
|
* ``` |
|
|
*/ |
|
|
*/ |
|
|
export async function compareDatabases(): Promise<DataComparison> { |
|
|
export async function compareDatabases(): Promise<DataComparison> { |
|
|
logger.info("[MigrationService] Starting database comparison"); |
|
|
logger.info("[IndexedDBMigrationService] Starting database comparison"); |
|
|
|
|
|
|
|
|
const [ |
|
|
const [ |
|
|
dexieContacts, |
|
|
dexieContacts, |
|
@ -470,7 +487,7 @@ export async function compareDatabases(): Promise<DataComparison> { |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
logger.info("[MigrationService] Database comparison completed", { |
|
|
logger.info("[IndexedDBMigrationService] Database comparison completed", { |
|
|
dexieContacts: dexieContacts.length, |
|
|
dexieContacts: dexieContacts.length, |
|
|
sqliteContacts: sqliteContacts.length, |
|
|
sqliteContacts: sqliteContacts.length, |
|
|
dexieSettings: dexieSettings.length, |
|
|
dexieSettings: dexieSettings.length, |
|
@ -679,6 +696,7 @@ function compareAccounts(dexieAccounts: Account[], sqliteDids: string[]) { |
|
|
* ``` |
|
|
* ``` |
|
|
*/ |
|
|
*/ |
|
|
function contactsEqual(contact1: Contact, contact2: Contact): boolean { |
|
|
function contactsEqual(contact1: Contact, contact2: Contact): boolean { |
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
const ifEmpty = (arg: any, def: any) => (arg ? arg : def); |
|
|
const ifEmpty = (arg: any, def: any) => (arg ? arg : def); |
|
|
const contact1Methods = |
|
|
const contact1Methods = |
|
|
contact1.contactMethods && |
|
|
contact1.contactMethods && |
|
@ -954,7 +972,7 @@ export function generateComparisonYaml(comparison: DataComparison): string { |
|
|
export async function migrateContacts( |
|
|
export async function migrateContacts( |
|
|
overwriteExisting: boolean = false, |
|
|
overwriteExisting: boolean = false, |
|
|
): Promise<MigrationResult> { |
|
|
): Promise<MigrationResult> { |
|
|
logger.info("[MigrationService] Starting contact migration", { |
|
|
logger.info("[IndexedDBMigrationService] Starting contact migration", { |
|
|
overwriteExisting, |
|
|
overwriteExisting, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -990,7 +1008,7 @@ export async function migrateContacts( |
|
|
); |
|
|
); |
|
|
await platformService.dbExec(sql, params); |
|
|
await platformService.dbExec(sql, params); |
|
|
result.contactsMigrated++; |
|
|
result.contactsMigrated++; |
|
|
logger.info(`[MigrationService] Updated contact: ${contact.did}`); |
|
|
logger.info(`[IndexedDBMigrationService] Updated contact: ${contact.did}`); |
|
|
} else { |
|
|
} else { |
|
|
result.warnings.push( |
|
|
result.warnings.push( |
|
|
`Contact ${contact.did} already exists, skipping`, |
|
|
`Contact ${contact.did} already exists, skipping`, |
|
@ -1004,17 +1022,17 @@ export async function migrateContacts( |
|
|
); |
|
|
); |
|
|
await platformService.dbExec(sql, params); |
|
|
await platformService.dbExec(sql, params); |
|
|
result.contactsMigrated++; |
|
|
result.contactsMigrated++; |
|
|
logger.info(`[MigrationService] Added contact: ${contact.did}`); |
|
|
logger.info(`[IndexedDBMigrationService] Added contact: ${contact.did}`); |
|
|
} |
|
|
} |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
const errorMsg = `Failed to migrate contact ${contact.did}: ${error}`; |
|
|
const errorMsg = `Failed to migrate contact ${contact.did}: ${error}`; |
|
|
logger.error("[MigrationService]", errorMsg); |
|
|
logger.error("[IndexedDBMigrationService]", errorMsg); |
|
|
result.errors.push(errorMsg); |
|
|
result.errors.push(errorMsg); |
|
|
result.success = false; |
|
|
result.success = false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
logger.info("[MigrationService] Contact migration completed", { |
|
|
logger.info("[IndexedDBMigrationService] Contact migration completed", { |
|
|
contactsMigrated: result.contactsMigrated, |
|
|
contactsMigrated: result.contactsMigrated, |
|
|
errors: result.errors.length, |
|
|
errors: result.errors.length, |
|
|
warnings: result.warnings.length, |
|
|
warnings: result.warnings.length, |
|
@ -1023,7 +1041,7 @@ export async function migrateContacts( |
|
|
return result; |
|
|
return result; |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
const errorMsg = `Contact migration failed: ${error}`; |
|
|
const errorMsg = `Contact migration failed: ${error}`; |
|
|
logger.error("[MigrationService]", errorMsg); |
|
|
logger.error("[IndexedDBMigrationService]", errorMsg); |
|
|
result.errors.push(errorMsg); |
|
|
result.errors.push(errorMsg); |
|
|
result.success = false; |
|
|
result.success = false; |
|
|
return result; |
|
|
return result; |
|
@ -1063,7 +1081,7 @@ export async function migrateContacts( |
|
|
* ``` |
|
|
* ``` |
|
|
*/ |
|
|
*/ |
|
|
export async function migrateSettings(): Promise<MigrationResult> { |
|
|
export async function migrateSettings(): Promise<MigrationResult> { |
|
|
logger.info("[MigrationService] Starting settings migration"); |
|
|
logger.info("[IndexedDBMigrationService] Starting settings migration"); |
|
|
|
|
|
|
|
|
const result: MigrationResult = { |
|
|
const result: MigrationResult = { |
|
|
success: true, |
|
|
success: true, |
|
@ -1076,17 +1094,17 @@ export async function migrateSettings(): Promise<MigrationResult> { |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
const dexieSettings = await getDexieSettings(); |
|
|
const dexieSettings = await getDexieSettings(); |
|
|
logger.info("[MigrationService] Migrating settings", { |
|
|
logger.info("[IndexedDBMigrationService] Migrating settings", { |
|
|
dexieSettings: dexieSettings.length, |
|
|
dexieSettings: dexieSettings.length, |
|
|
}); |
|
|
}); |
|
|
const platformService = PlatformServiceFactory.getInstance(); |
|
|
const platformService = PlatformServiceFactory.getInstance(); |
|
|
|
|
|
|
|
|
// Create an array of promises for all settings migrations
|
|
|
// Create an array of promises for all settings migrations
|
|
|
const migrationPromises = dexieSettings.map(async (setting) => { |
|
|
const migrationPromises = dexieSettings.map(async (setting) => { |
|
|
logger.info("[MigrationService] Starting to migrate settings", setting); |
|
|
logger.info( |
|
|
let sqliteSettingRaw: |
|
|
"[IndexedDBMigrationService] Starting to migrate settings", |
|
|
| { columns: string[]; values: unknown[][] } |
|
|
setting, |
|
|
| undefined; |
|
|
); |
|
|
|
|
|
|
|
|
// adjust SQL based on the accountDid key, maybe null
|
|
|
// adjust SQL based on the accountDid key, maybe null
|
|
|
let conditional: string; |
|
|
let conditional: string; |
|
@ -1098,15 +1116,18 @@ export async function migrateSettings(): Promise<MigrationResult> { |
|
|
conditional = "accountDid = ?"; |
|
|
conditional = "accountDid = ?"; |
|
|
preparams = [setting.accountDid]; |
|
|
preparams = [setting.accountDid]; |
|
|
} |
|
|
} |
|
|
sqliteSettingRaw = await platformService.dbQuery( |
|
|
const sqliteSettingRaw = await platformService.dbQuery( |
|
|
"SELECT * FROM settings WHERE " + conditional, |
|
|
"SELECT * FROM settings WHERE " + conditional, |
|
|
preparams, |
|
|
preparams, |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
logger.info("[MigrationService] Migrating one set of settings:", { |
|
|
logger.info( |
|
|
setting, |
|
|
"[IndexedDBMigrationService] Migrating one set of settings:", |
|
|
sqliteSettingRaw, |
|
|
{ |
|
|
}); |
|
|
setting, |
|
|
|
|
|
sqliteSettingRaw, |
|
|
|
|
|
}, |
|
|
|
|
|
); |
|
|
if (sqliteSettingRaw?.values?.length) { |
|
|
if (sqliteSettingRaw?.values?.length) { |
|
|
// should cover the master settings, where accountDid is null
|
|
|
// should cover the master settings, where accountDid is null
|
|
|
delete setting.id; // don't conflict with the id in the sqlite database
|
|
|
delete setting.id; // don't conflict with the id in the sqlite database
|
|
@ -1117,7 +1138,7 @@ export async function migrateSettings(): Promise<MigrationResult> { |
|
|
conditional, |
|
|
conditional, |
|
|
preparams, |
|
|
preparams, |
|
|
); |
|
|
); |
|
|
logger.info("[MigrationService] Updating settings", { |
|
|
logger.info("[IndexedDBMigrationService] Updating settings", { |
|
|
sql, |
|
|
sql, |
|
|
params, |
|
|
params, |
|
|
}); |
|
|
}); |
|
@ -1127,10 +1148,7 @@ export async function migrateSettings(): Promise<MigrationResult> { |
|
|
// insert new setting
|
|
|
// insert new setting
|
|
|
delete setting.id; // don't conflict with the id in the sqlite database
|
|
|
delete setting.id; // don't conflict with the id in the sqlite database
|
|
|
delete setting.activeDid; // ensure we don't set the activeDid (since master settings are an update and don't hit this case)
|
|
|
delete setting.activeDid; // ensure we don't set the activeDid (since master settings are an update and don't hit this case)
|
|
|
const { sql, params } = generateInsertStatement( |
|
|
const { sql, params } = generateInsertStatement(setting, "settings"); |
|
|
setting, |
|
|
|
|
|
"settings", |
|
|
|
|
|
); |
|
|
|
|
|
await platformService.dbExec(sql, params); |
|
|
await platformService.dbExec(sql, params); |
|
|
result.settingsMigrated++; |
|
|
result.settingsMigrated++; |
|
|
} |
|
|
} |
|
@ -1140,7 +1158,7 @@ export async function migrateSettings(): Promise<MigrationResult> { |
|
|
const updatedSettings = await Promise.all(migrationPromises); |
|
|
const updatedSettings = await Promise.all(migrationPromises); |
|
|
|
|
|
|
|
|
logger.info( |
|
|
logger.info( |
|
|
"[MigrationService] Finished migrating settings", |
|
|
"[IndexedDBMigrationService] Finished migrating settings", |
|
|
updatedSettings, |
|
|
updatedSettings, |
|
|
result, |
|
|
result, |
|
|
); |
|
|
); |
|
@ -1148,7 +1166,7 @@ export async function migrateSettings(): Promise<MigrationResult> { |
|
|
return result; |
|
|
return result; |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
logger.error( |
|
|
logger.error( |
|
|
"[MigrationService] Complete settings migration failed:", |
|
|
"[IndexedDBMigrationService] Complete settings migration failed:", |
|
|
error, |
|
|
error, |
|
|
); |
|
|
); |
|
|
const errorMessage = `Settings migration failed: ${error}`; |
|
|
const errorMessage = `Settings migration failed: ${error}`; |
|
@ -1192,7 +1210,7 @@ export async function migrateSettings(): Promise<MigrationResult> { |
|
|
* ``` |
|
|
* ``` |
|
|
*/ |
|
|
*/ |
|
|
export async function migrateAccounts(): Promise<MigrationResult> { |
|
|
export async function migrateAccounts(): Promise<MigrationResult> { |
|
|
logger.info("[MigrationService] Starting account migration"); |
|
|
logger.info("[IndexedDBMigrationService] Starting account migration"); |
|
|
|
|
|
|
|
|
const result: MigrationResult = { |
|
|
const result: MigrationResult = { |
|
|
success: true, |
|
|
success: true, |
|
@ -1248,14 +1266,17 @@ export async function migrateAccounts(): Promise<MigrationResult> { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
logger.info("[MigrationService] Successfully migrated account", { |
|
|
logger.info( |
|
|
did, |
|
|
"[IndexedDBMigrationService] Successfully migrated account", |
|
|
dateCreated: account.dateCreated, |
|
|
{ |
|
|
}); |
|
|
did, |
|
|
|
|
|
dateCreated: account.dateCreated, |
|
|
|
|
|
}, |
|
|
|
|
|
); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
const errorMessage = `Failed to migrate account ${did}: ${error}`; |
|
|
const errorMessage = `Failed to migrate account ${did}: ${error}`; |
|
|
result.errors.push(errorMessage); |
|
|
result.errors.push(errorMessage); |
|
|
logger.error("[MigrationService] Account migration failed:", { |
|
|
logger.error("[IndexedDBMigrationService] Account migration failed:", { |
|
|
error, |
|
|
error, |
|
|
did, |
|
|
did, |
|
|
}); |
|
|
}); |
|
@ -1272,7 +1293,7 @@ export async function migrateAccounts(): Promise<MigrationResult> { |
|
|
result.errors.push(errorMessage); |
|
|
result.errors.push(errorMessage); |
|
|
result.success = false; |
|
|
result.success = false; |
|
|
logger.error( |
|
|
logger.error( |
|
|
"[MigrationService] Complete account migration failed:", |
|
|
"[IndexedDBMigrationService] Complete account migration failed:", |
|
|
error, |
|
|
error, |
|
|
); |
|
|
); |
|
|
return result; |
|
|
return result; |
|
@ -1306,11 +1327,11 @@ export async function migrateAll(): Promise<MigrationResult> { |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
logger.info( |
|
|
logger.info( |
|
|
"[MigrationService] Starting complete migration from Dexie to SQLite", |
|
|
"[IndexedDBMigrationService] Starting complete migration from Dexie to SQLite", |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
// Step 1: Migrate Accounts (foundational)
|
|
|
// Step 1: Migrate Accounts (foundational)
|
|
|
logger.info("[MigrationService] Step 1: Migrating accounts..."); |
|
|
logger.info("[IndexedDBMigrationService] Step 1: Migrating accounts..."); |
|
|
const accountsResult = await migrateAccounts(); |
|
|
const accountsResult = await migrateAccounts(); |
|
|
if (!accountsResult.success) { |
|
|
if (!accountsResult.success) { |
|
|
result.errors.push( |
|
|
result.errors.push( |
|
@ -1322,7 +1343,7 @@ export async function migrateAll(): Promise<MigrationResult> { |
|
|
result.warnings.push(...accountsResult.warnings); |
|
|
result.warnings.push(...accountsResult.warnings); |
|
|
|
|
|
|
|
|
// Step 2: Migrate Settings (depends on accounts)
|
|
|
// Step 2: Migrate Settings (depends on accounts)
|
|
|
logger.info("[MigrationService] Step 2: Migrating settings..."); |
|
|
logger.info("[IndexedDBMigrationService] Step 2: Migrating settings..."); |
|
|
const settingsResult = await migrateSettings(); |
|
|
const settingsResult = await migrateSettings(); |
|
|
if (!settingsResult.success) { |
|
|
if (!settingsResult.success) { |
|
|
result.errors.push( |
|
|
result.errors.push( |
|
@ -1335,7 +1356,7 @@ export async function migrateAll(): Promise<MigrationResult> { |
|
|
|
|
|
|
|
|
// Step 4: Migrate Contacts (independent, but after accounts for consistency)
|
|
|
// Step 4: Migrate Contacts (independent, but after accounts for consistency)
|
|
|
// ... but which is better done through the contact import view
|
|
|
// ... but which is better done through the contact import view
|
|
|
// logger.info("[MigrationService] Step 4: Migrating contacts...");
|
|
|
// logger.info("[IndexedDBMigrationService] Step 4: Migrating contacts...");
|
|
|
// const contactsResult = await migrateContacts();
|
|
|
// const contactsResult = await migrateContacts();
|
|
|
// if (!contactsResult.success) {
|
|
|
// if (!contactsResult.success) {
|
|
|
// result.errors.push(
|
|
|
// result.errors.push(
|
|
@ -1354,7 +1375,7 @@ export async function migrateAll(): Promise<MigrationResult> { |
|
|
result.contactsMigrated; |
|
|
result.contactsMigrated; |
|
|
|
|
|
|
|
|
logger.info( |
|
|
logger.info( |
|
|
`[MigrationService] Complete migration successful: ${totalMigrated} total records migrated`, |
|
|
`[IndexedDBMigrationService] Complete migration successful: ${totalMigrated} total records migrated`, |
|
|
{ |
|
|
{ |
|
|
accounts: result.accountsMigrated, |
|
|
accounts: result.accountsMigrated, |
|
|
settings: result.settingsMigrated, |
|
|
settings: result.settingsMigrated, |
|
@ -1367,7 +1388,10 @@ export async function migrateAll(): Promise<MigrationResult> { |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
const errorMessage = `Complete migration failed: ${error}`; |
|
|
const errorMessage = `Complete migration failed: ${error}`; |
|
|
result.errors.push(errorMessage); |
|
|
result.errors.push(errorMessage); |
|
|
logger.error("[MigrationService] Complete migration failed:", error); |
|
|
logger.error( |
|
|
|
|
|
"[IndexedDBMigrationService] Complete migration failed:", |
|
|
|
|
|
error, |
|
|
|
|
|
); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|