Browse Source

IndexedDB migration: ensure output is printed during comparison (no logic changes)

Trent Larson 2 weeks ago
parent
commit
a248e9a5a3
  1. 27
      src/services/indexedDBMigrationService.ts

27
src/services/indexedDBMigrationService.ts

@ -182,11 +182,9 @@ export async function getSqliteContacts(): Promise<Contact[]> {
const platformService = PlatformServiceFactory.getInstance();
const result = await platformService.dbQuery("SELECT * FROM contacts");
if (!result?.values?.length) {
return [];
}
const contacts = result.values.map((row) => {
let contacts: Contact[] = [];
if (result?.values?.length) {
contacts = result.values.map((row) => {
const contact = parseJsonField(row, {}) as Contact;
return {
did: contact.did || "",
@ -203,6 +201,7 @@ export async function getSqliteContacts(): Promise<Contact[]> {
registered: contact.registered || false,
} as Contact;
});
}
logger.info(
`[MigrationService] Retrieved ${contacts.length} contacts from SQLite`,
@ -280,11 +279,9 @@ export async function getSqliteSettings(): Promise<Settings[]> {
const platformService = PlatformServiceFactory.getInstance();
const result = await platformService.dbQuery("SELECT * FROM settings");
if (!result?.values?.length) {
return [];
}
const settings = result.values.map((row) => {
let settings: Settings[] = [];
if (result?.values?.length) {
settings = result.values.map((row) => {
const setting = parseJsonField(row, {}) as Settings;
return {
id: setting.id,
@ -315,6 +312,7 @@ export async function getSqliteSettings(): Promise<Settings[]> {
vapid: setting.vapid || "",
} as Settings;
});
}
logger.info(
`[MigrationService] Retrieved ${settings.length} settings from SQLite`,
@ -355,11 +353,9 @@ export async function getSqliteAccounts(): Promise<Account[]> {
const platformService = PlatformServiceFactory.getInstance();
const result = await platformService.dbQuery("SELECT * FROM accounts");
if (!result?.values?.length) {
return [];
}
const accounts = result.values.map((row) => {
let accounts: Account[] = [];
if (result?.values?.length) {
accounts = result.values.map((row) => {
const account = parseJsonField(row, {}) as Account;
return {
id: account.id,
@ -372,6 +368,7 @@ export async function getSqliteAccounts(): Promise<Account[]> {
publicKeyHex: account.publicKeyHex || "",
} as Account;
});
}
logger.info(
`[MigrationService] Retrieved ${accounts.length} accounts from SQLite`,

Loading…
Cancel
Save