WIP: restore database migration system and improve error handling
- Restore runMigrations functionality for database schema migrations - Remove indexedDBMigrationService.ts (was for IndexedDB to SQLite migration) - Recreate migrationService.ts and db-sql/migration.ts for schema management - Add proper TypeScript error handling with type guards in AccountViewView - Fix CreateAndSubmitClaimResult property access in QuickActionBvcBeginView - Remove LeafletMouseEvent from Vue components array (it's a type, not component) - Add null check for UserNameDialog callback to prevent undefined assignment - Implement extractErrorMessage helper function for consistent error handling - Update router to remove database-migration route The migration system now properly handles database schema evolution across app versions, while the IndexedDB to SQLite migration service has been removed as it was specific to that one-time migration.
This commit is contained in:
@@ -339,7 +339,7 @@ import { Component, Vue } from "vue-facing-decorator";
|
||||
import { Router } from "vue-router";
|
||||
|
||||
import QuickNav from "../components/QuickNav.vue";
|
||||
import { AppString, NotificationIface, USE_DEXIE_DB } from "../constants/app";
|
||||
import { AppString, NotificationIface } from "../constants/app";
|
||||
import * as databaseUtil from "../db/databaseUtil";
|
||||
import { db, retrieveSettingsForActiveAccount } from "../db/index";
|
||||
import * as vcLib from "../libs/crypto/vc";
|
||||
@@ -399,10 +399,7 @@ export default class Help extends Vue {
|
||||
cryptoLib = cryptoLib;
|
||||
|
||||
async mounted() {
|
||||
let settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
||||
if (USE_DEXIE_DB) {
|
||||
settings = await retrieveSettingsForActiveAccount();
|
||||
}
|
||||
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
||||
this.activeDid = settings.activeDid || "";
|
||||
this.userName = settings.firstName;
|
||||
|
||||
@@ -438,7 +435,7 @@ export default class Help extends Vue {
|
||||
"SELECT * FROM temp WHERE id = ?",
|
||||
[SHARED_PHOTO_BASE64_KEY],
|
||||
);
|
||||
let temp = databaseUtil.mapQueryResultToValues(
|
||||
const temp = databaseUtil.mapQueryResultToValues(
|
||||
tempQuery,
|
||||
)?.[0] as Temp;
|
||||
if (temp) {
|
||||
@@ -452,16 +449,6 @@ export default class Help extends Vue {
|
||||
[SHARED_PHOTO_BASE64_KEY, blobB64],
|
||||
);
|
||||
}
|
||||
if (USE_DEXIE_DB) {
|
||||
temp = (await db.temp.get(
|
||||
SHARED_PHOTO_BASE64_KEY,
|
||||
)) as unknown as Temp;
|
||||
if (temp) {
|
||||
await db.temp.update(SHARED_PHOTO_BASE64_KEY, { blobB64 });
|
||||
} else {
|
||||
await db.temp.add({ id: SHARED_PHOTO_BASE64_KEY, blobB64 });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
reader.readAsArrayBuffer(file as Blob);
|
||||
|
||||
Reference in New Issue
Block a user