|
@ -87,7 +87,7 @@ interface VueComponentWithMixin { |
|
|
// VueComponentWithMixin,
|
|
|
// VueComponentWithMixin,
|
|
|
// Map<string, CacheEntry<unknown>>
|
|
|
// Map<string, CacheEntry<unknown>>
|
|
|
// >();
|
|
|
// >();
|
|
|
//
|
|
|
//
|
|
|
// /**
|
|
|
// /**
|
|
|
// * Cache configuration constants
|
|
|
// * Cache configuration constants
|
|
|
// */
|
|
|
// */
|
|
@ -220,13 +220,20 @@ export const PlatformServiceMixin = { |
|
|
const obj: Record<string, unknown> = {}; |
|
|
const obj: Record<string, unknown> = {}; |
|
|
columns.forEach((column, index) => { |
|
|
columns.forEach((column, index) => { |
|
|
let value = row[index]; |
|
|
let value = row[index]; |
|
|
|
|
|
|
|
|
// Convert SQLite integer booleans to JavaScript booleans
|
|
|
// Convert SQLite integer booleans to JavaScript booleans
|
|
|
if (column === 'isRegistered' || column === 'finishedOnboarding' || |
|
|
if ( |
|
|
column === 'filterFeedByVisible' || column === 'filterFeedByNearby' || |
|
|
column === "isRegistered" || |
|
|
column === 'hideRegisterPromptOnNewContact' || column === 'showContactGivesInline' || |
|
|
column === "finishedOnboarding" || |
|
|
column === 'showGeneralAdvanced' || column === 'showShortcutBvc' || |
|
|
column === "filterFeedByVisible" || |
|
|
column === 'warnIfProdServer' || column === 'warnIfTestServer') { |
|
|
column === "filterFeedByNearby" || |
|
|
|
|
|
column === "hideRegisterPromptOnNewContact" || |
|
|
|
|
|
column === "showContactGivesInline" || |
|
|
|
|
|
column === "showGeneralAdvanced" || |
|
|
|
|
|
column === "showShortcutBvc" || |
|
|
|
|
|
column === "warnIfProdServer" || |
|
|
|
|
|
column === "warnIfTestServer" |
|
|
|
|
|
) { |
|
|
if (value === 1) { |
|
|
if (value === 1) { |
|
|
value = true; |
|
|
value = true; |
|
|
} else if (value === 0) { |
|
|
} else if (value === 0) { |
|
@ -234,7 +241,7 @@ export const PlatformServiceMixin = { |
|
|
} |
|
|
} |
|
|
// Keep null values as null
|
|
|
// Keep null values as null
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
obj[column] = value; |
|
|
obj[column] = value; |
|
|
}); |
|
|
}); |
|
|
return obj; |
|
|
return obj; |
|
@ -244,7 +251,7 @@ export const PlatformServiceMixin = { |
|
|
/** |
|
|
/** |
|
|
* Self-contained implementation of parseJsonField |
|
|
* Self-contained implementation of parseJsonField |
|
|
* Safely parses JSON strings with fallback to default value |
|
|
* Safely parses JSON strings with fallback to default value |
|
|
* |
|
|
* |
|
|
* Consolidate this with src/libs/util.ts parseJsonField |
|
|
* Consolidate this with src/libs/util.ts parseJsonField |
|
|
*/ |
|
|
*/ |
|
|
_parseJsonField<T>(value: unknown, defaultValue: T): T { |
|
|
_parseJsonField<T>(value: unknown, defaultValue: T): T { |
|
@ -1403,7 +1410,9 @@ export const PlatformServiceMixin = { |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
if (!result?.values?.length) { |
|
|
if (!result?.values?.length) { |
|
|
logger.warn(`[PlatformServiceMixin] No settings found for DID: ${did}`); |
|
|
logger.warn( |
|
|
|
|
|
`[PlatformServiceMixin] No settings found for DID: ${did}`, |
|
|
|
|
|
); |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1413,7 +1422,9 @@ export const PlatformServiceMixin = { |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
if (!mappedResults.length) { |
|
|
if (!mappedResults.length) { |
|
|
logger.warn(`[PlatformServiceMixin] Failed to map settings for DID: ${did}`); |
|
|
logger.warn( |
|
|
|
|
|
`[PlatformServiceMixin] Failed to map settings for DID: ${did}`, |
|
|
|
|
|
); |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1428,7 +1439,10 @@ export const PlatformServiceMixin = { |
|
|
|
|
|
|
|
|
return settings; |
|
|
return settings; |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
logger.error(`[PlatformServiceMixin] Error debugging settings for DID ${did}:`, error); |
|
|
logger.error( |
|
|
|
|
|
`[PlatformServiceMixin] Error debugging settings for DID ${did}:`, |
|
|
|
|
|
error, |
|
|
|
|
|
); |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -1442,14 +1456,24 @@ export const PlatformServiceMixin = { |
|
|
async $debugMergedSettings(did: string): Promise<void> { |
|
|
async $debugMergedSettings(did: string): Promise<void> { |
|
|
try { |
|
|
try { |
|
|
// Get default settings
|
|
|
// Get default settings
|
|
|
const defaultSettings = await this.$getSettings(MASTER_SETTINGS_KEY, {}); |
|
|
const defaultSettings = await this.$getSettings( |
|
|
logger.info(`[PlatformServiceMixin] Default settings:`, defaultSettings); |
|
|
MASTER_SETTINGS_KEY, |
|
|
|
|
|
{}, |
|
|
|
|
|
); |
|
|
|
|
|
logger.info( |
|
|
|
|
|
`[PlatformServiceMixin] Default settings:`, |
|
|
|
|
|
defaultSettings, |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
// Get DID-specific settings
|
|
|
// Get DID-specific settings
|
|
|
const didSettings = await this.$debugDidSettings(did); |
|
|
const didSettings = await this.$debugDidSettings(did); |
|
|
|
|
|
|
|
|
// Get merged settings
|
|
|
// Get merged settings
|
|
|
const mergedSettings = await this.$getMergedSettings(MASTER_SETTINGS_KEY, did, defaultSettings || {}); |
|
|
const mergedSettings = await this.$getMergedSettings( |
|
|
|
|
|
MASTER_SETTINGS_KEY, |
|
|
|
|
|
did, |
|
|
|
|
|
defaultSettings || {}, |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
logger.info(`[PlatformServiceMixin] Merged settings for ${did}:`, { |
|
|
logger.info(`[PlatformServiceMixin] Merged settings for ${did}:`, { |
|
|
defaultSettings, |
|
|
defaultSettings, |
|
@ -1458,7 +1482,10 @@ export const PlatformServiceMixin = { |
|
|
isRegistered: mergedSettings.isRegistered, |
|
|
isRegistered: mergedSettings.isRegistered, |
|
|
}); |
|
|
}); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
logger.error(`[PlatformServiceMixin] Error debugging merged settings for DID ${did}:`, error); |
|
|
logger.error( |
|
|
|
|
|
`[PlatformServiceMixin] Error debugging merged settings for DID ${did}:`, |
|
|
|
|
|
error, |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|