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:
Matthew Raymer
2025-06-23 08:25:10 +00:00
parent 419243b5cd
commit ebc241eba0
70 changed files with 185 additions and 3986 deletions

View File

@@ -105,7 +105,7 @@ import { Component, Vue } from "vue-facing-decorator";
import { Router } from "vue-router";
import QuickNav from "../components/QuickNav.vue";
import { NotificationIface, USE_DEXIE_DB } from "../constants/app";
import { NotificationIface } from "../constants/app";
import {
accountsDBPromise,
db,
@@ -130,10 +130,7 @@ export default class IdentitySwitcherView extends Vue {
async created() {
try {
let settings = await databaseUtil.retrieveSettingsForActiveAccount();
if (USE_DEXIE_DB) {
settings = await retrieveSettingsForActiveAccount();
}
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
this.activeDid = settings.activeDid || "";
this.apiServer = settings.apiServer || "";
this.apiServerInput = settings.apiServer || "";
@@ -165,12 +162,6 @@ export default class IdentitySwitcherView extends Vue {
async switchAccount(did?: string) {
await databaseUtil.updateDefaultSettings({ activeDid: did });
if (USE_DEXIE_DB) {
await db.open();
await db.settings.update(MASTER_SETTINGS_KEY, {
activeDid: did,
});
}
this.$router.push({ name: "account" });
}
@@ -186,11 +177,6 @@ export default class IdentitySwitcherView extends Vue {
await platformService.dbExec(`DELETE FROM accounts WHERE id = ?`, [
id,
]);
if (USE_DEXIE_DB) {
// one of the few times we use accountsDBPromise directly; try to avoid more usage
const accountsDB = await accountsDBPromise;
await accountsDB.accounts.delete(id);
}
this.otherIdentities = this.otherIdentities.filter(
(ident) => ident.id !== id,
);