fix(platform): remove auto-fix identity selection and fix feed loading race condition

- Remove problematic $ensureActiveIdentityPopulated() that auto-selected identities
- Add user-friendly $needsActiveIdentitySelection() and $getAvailableAccountDids() methods
- Fix missing updateActiveDid implementation in CapacitorPlatformService
- Resolve race condition in HomeView initialization causing feed loading failures
- Improve TypeScript error handling in ContactsView invite processing

Addresses team concerns about data consistency and user control for identity selection.
This commit is contained in:
Matthew Raymer
2025-09-04 10:36:50 +00:00
parent 720be1aa4d
commit 10a1f435ed
4 changed files with 117 additions and 88 deletions

View File

@@ -1319,6 +1319,13 @@ export class CapacitorPlatformService implements PlatformService {
await this.dbExec(sql, params);
}
async updateActiveDid(did: string): Promise<void> {
await this.dbExec(
"UPDATE active_identity SET activeDid = ?, lastUpdated = datetime('now') WHERE id = 1",
[did],
);
}
async insertNewDidIntoSettings(did: string): Promise<void> {
await this.dbExec("INSERT INTO settings (accountDid) VALUES (?)", [did]);
}