From 46d7fee95ea0172a8dcc20b9af214473cbf05ee1 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Wed, 24 Sep 2025 09:10:21 -0600 Subject: [PATCH] fix: remove settings, too, when deleting an identity --- src/db-sql/migration.ts | 2 +- src/views/IdentitySwitcherView.vue | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db-sql/migration.ts b/src/db-sql/migration.ts index 14dc36d4..81b3d913 100644 --- a/src/db-sql/migration.ts +++ b/src/db-sql/migration.ts @@ -79,8 +79,8 @@ const MIG_004_SQL = ` warnIfTestServer = (SELECT warnIfTestServer FROM settings WHERE id = 1); -- CLEANUP: Remove orphaned settings records and clear legacy activeDid values + -- which usually simply clears out the MASTER_SETTINGS_KEY record. -- This completes the migration from settings-based to table-based active identity - -- Use guarded operations to prevent accidental data loss DELETE FROM settings WHERE accountDid IS NULL; UPDATE settings SET activeDid = NULL; `; diff --git a/src/views/IdentitySwitcherView.vue b/src/views/IdentitySwitcherView.vue index 0e5516e6..8a369ac6 100644 --- a/src/views/IdentitySwitcherView.vue +++ b/src/views/IdentitySwitcherView.vue @@ -306,6 +306,7 @@ export default class IdentitySwitcherView extends Vue { } await this.$exec("DELETE FROM accounts WHERE id = ?", [id]); + await this.$exec("DELETE FROM settings WHERE accountDid = ?", [accountDid]); }); // Update UI