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

@@ -78,7 +78,6 @@ import {
DEFAULT_IMAGE_API_SERVER,
IMAGE_TYPE_PROFILE,
NotificationIface,
USE_DEXIE_DB,
} from "../constants/app";
import * as databaseUtil from "../db/databaseUtil";
import { db, retrieveSettingsForActiveAccount } from "../db/index";
@@ -104,10 +103,7 @@ export default class SharedPhotoView extends Vue {
// 'created' hook runs when the Vue instance is first created
async mounted() {
try {
let settings = await databaseUtil.retrieveSettingsForActiveAccount();
if (USE_DEXIE_DB) {
settings = await retrieveSettingsForActiveAccount();
}
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
this.activeDid = settings.activeDid;
const platformService = PlatformServiceFactory.getInstance();
@@ -115,10 +111,7 @@ export default class SharedPhotoView extends Vue {
"SELECT * FROM temp WHERE id = ?",
[SHARED_PHOTO_BASE64_KEY],
);
let temp = databaseUtil.mapQueryResultToValues(tempQuery)?.[0] as Temp;
if (USE_DEXIE_DB) {
temp = (await db.temp.get(SHARED_PHOTO_BASE64_KEY)) as unknown as Temp;
}
const temp = databaseUtil.mapQueryResultToValues(tempQuery)?.[0] as Temp;
const imageB64 = temp?.blobB64 as string;
if (temp) {
this.imageBlob = base64ToBlob(imageB64);
@@ -127,9 +120,6 @@ export default class SharedPhotoView extends Vue {
await platformService.dbExec("DELETE FROM temp WHERE id = ?", [
SHARED_PHOTO_BASE64_KEY,
]);
if (USE_DEXIE_DB) {
await db.temp.delete(SHARED_PHOTO_BASE64_KEY);
}
this.imageFileName = this.$route.query["fileName"] as string;
} else {
@@ -171,11 +161,6 @@ export default class SharedPhotoView extends Vue {
(this.$refs.photoDialog as PhotoDialog).open(
async (imgUrl) => {
databaseUtil.updateDefaultSettings({ profileImageUrl: imgUrl });
if (USE_DEXIE_DB) {
await db.settings.update(MASTER_SETTINGS_KEY, {
profileImageUrl: imgUrl,
});
}
this.$router.push({ name: "account" });
},
IMAGE_TYPE_PROFILE,