|
@ -613,7 +613,9 @@ export const PlatformServiceMixin = { |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
if (!result?.values?.length) { |
|
|
if (!result?.values?.length) { |
|
|
logger.warn("[PlatformServiceMixin] Active identity table is empty - this may indicate a migration issue"); |
|
|
logger.warn( |
|
|
|
|
|
"[PlatformServiceMixin] Active identity table is empty - this may indicate a migration issue", |
|
|
|
|
|
); |
|
|
return { activeDid: "" }; |
|
|
return { activeDid: "" }; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -634,7 +636,9 @@ export const PlatformServiceMixin = { |
|
|
return { activeDid: firstAccountDid }; |
|
|
return { activeDid: firstAccountDid }; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
logger.warn("[PlatformServiceMixin] No accounts available for auto-selection"); |
|
|
logger.warn( |
|
|
|
|
|
"[PlatformServiceMixin] No accounts available for auto-selection", |
|
|
|
|
|
); |
|
|
return { activeDid: "" }; |
|
|
return { activeDid: "" }; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -649,13 +653,18 @@ export const PlatformServiceMixin = { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Clear corrupted activeDid and return empty
|
|
|
// Clear corrupted activeDid and return empty
|
|
|
logger.warn("[PlatformServiceMixin] Active identity not found in accounts, clearing"); |
|
|
logger.warn( |
|
|
|
|
|
"[PlatformServiceMixin] Active identity not found in accounts, clearing", |
|
|
|
|
|
); |
|
|
await this.$dbExec( |
|
|
await this.$dbExec( |
|
|
"UPDATE active_identity SET activeDid = NULL, lastUpdated = datetime('now') WHERE id = 1", |
|
|
"UPDATE active_identity SET activeDid = NULL, lastUpdated = datetime('now') WHERE id = 1", |
|
|
); |
|
|
); |
|
|
return { activeDid: "" }; |
|
|
return { activeDid: "" }; |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
logger.error("[PlatformServiceMixin] Error getting active identity:", error); |
|
|
logger.error( |
|
|
|
|
|
"[PlatformServiceMixin] Error getting active identity:", |
|
|
|
|
|
error, |
|
|
|
|
|
); |
|
|
return { activeDid: "" }; |
|
|
return { activeDid: "" }; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|