Merge branch 'master' into daily-notification-plugin-integration

This commit is contained in:
2026-03-07 10:48:07 -07:00
56 changed files with 3450 additions and 13063 deletions

View File

@@ -114,8 +114,7 @@ export interface DatabaseExport {
const _memoryLogs: string[] = [];
/**
* Enhanced mixin that provides cached platform service access and utility methods
* with smart caching layer for ultimate performance optimization
* Enhanced mixin that provides platform utility methods
*/
export const PlatformServiceMixin = {
data() {
@@ -298,7 +297,7 @@ export const PlatformServiceMixin = {
column === "warnIfTestServer" ||
column === "reminderFastRolloverForTesting" ||
// contacts
column === "iViewContent" ||
column === "hideTheirContent" ||
column === "registered" ||
column === "seesMe"
) {
@@ -913,7 +912,7 @@ export const PlatformServiceMixin = {
// Create a new contact object with proper typing
const normalizedContact: Contact = {
did: contact.did,
iViewContent: contact.iViewContent,
hideTheirContent: contact.hideTheirContent,
name: contact.name,
nextPubKeyHashB64: contact.nextPubKeyHashB64,
notes: contact.notes,
@@ -1012,7 +1011,7 @@ export const PlatformServiceMixin = {
},
/**
* Load settings with optional defaults WITHOUT caching - $settings()
* Load settings with optional defaults - $settings()
* Settings are loaded fresh every time for immediate consistency
* @param defaults Optional default values
* @returns Fresh settings object from database
@@ -1035,11 +1034,11 @@ export const PlatformServiceMixin = {
settings.apiServer = DEFAULT_ENDORSER_API_SERVER;
}
return settings; // Return fresh data without caching
return settings;
},
/**
* Load account-specific settings WITHOUT caching - $accountSettings()
* Load account-specific settings - $accountSettings()
* Settings are loaded fresh every time for immediate consistency
* @param did DID identifier (optional, uses current active DID)
* @param defaults Optional default values
@@ -1117,8 +1116,8 @@ export const PlatformServiceMixin = {
// =================================================
/**
* Save default settings - $saveSettings()
* Ultra-concise shortcut for updateDefaultSettings
* Save settings for currently active DID
* May be consolidated with $saveUserSettings()
*
* ✅ KEEP: This method will be the primary settings save method after consolidation
*
@@ -1206,8 +1205,8 @@ export const PlatformServiceMixin = {
},
/**
* Save user-specific settings - $saveUserSettings()
* Ultra-concise shortcut for updateDidSpecificSettings
* Save DID-specific settings - $saveUserSettings()
*
* @param did DID identifier
* @param changes Settings changes to save
* @returns Promise<boolean> Success status
@@ -1382,8 +1381,10 @@ export const PlatformServiceMixin = {
? contact.profileImageUrl
: null,
notes: contact.notes !== undefined ? contact.notes : null,
iViewContent:
contact.iViewContent !== undefined ? contact.iViewContent : null,
hideTheirContent:
contact.hideTheirContent !== undefined
? contact.hideTheirContent
: null,
contactMethods:
contact.contactMethods !== undefined
? Array.isArray(contact.contactMethods)
@@ -1394,7 +1395,7 @@ export const PlatformServiceMixin = {
await this.$dbExec(
`INSERT OR REPLACE INTO contacts
(did, name, publicKeyBase64, seesMe, registered, nextPubKeyHashB64, profileImageUrl, notes, iViewContent, contactMethods)
(did, name, publicKeyBase64, seesMe, registered, nextPubKeyHashB64, profileImageUrl, notes, hideTheirContent, contactMethods)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
[
safeContact.did,
@@ -1405,7 +1406,7 @@ export const PlatformServiceMixin = {
safeContact.nextPubKeyHashB64,
safeContact.profileImageUrl,
safeContact.notes,
safeContact.iViewContent,
safeContact.hideTheirContent,
safeContact.contactMethods,
],
);
@@ -1732,8 +1733,9 @@ export const PlatformServiceMixin = {
// =================================================
/**
* Get temporary data by ID - $getTemp()
* Retrieves temporary data from the temp table
* Get data from temp table by ID
* Currently set by main.capacitor.ts storeSharedImageInTempDB()
*
* @param id Temporary storage ID
* @returns Promise<Temp | null> Temporary data or null if not found
*/
@@ -1747,8 +1749,8 @@ export const PlatformServiceMixin = {
},
/**
* Delete temporary data by ID - $deleteTemp()
* Removes temporary data from the temp table
* Delete data from temp table by ID
*
* @param id Temporary storage ID
* @returns Promise<boolean> Success status
*/
@@ -2243,7 +2245,7 @@ export const PlatformServiceMixin = {
// =================================================
/**
* Enhanced interface with caching utility methods
* Enhanced interface
*/
export interface IPlatformServiceMixin {
platformService: PlatformService;