feat(launcher): implement device heartbeat and background sync engine

- Hardened 'find_object_id' in Dexie to support 'event_' prefixed IDs.
- Implemented singleton 'LauncherBackgroundSync' in root launcher layout.
- Added V3-compliant heartbeat and room refresh cycles.
- Fixed redundant component imports and Skeleton UI prop errors.
- Added 'inc_file_li' support to event API loader.
This commit is contained in:
Scott Idem
2026-01-26 11:23:12 -05:00
parent 54a2cfa59f
commit 79917edffc
9 changed files with 61 additions and 27 deletions

View File

@@ -13,7 +13,14 @@ function find_object_id(
table_name: string,
log_lvl: number
): string | number | undefined {
const potential_keys = ['id', 'id_random', `${table_name}_id`, `${table_name}_id_random`];
const potential_keys = [
'id',
'id_random',
`${table_name}_id`,
`${table_name}_id_random`,
`event_${table_name}_id`,
`event_${table_name}_id_random`
];
for (const key of potential_keys) {
if (obj[key]) {
@@ -27,10 +34,12 @@ function find_object_id(
}
}
console.error(
`Object is missing a valid ID for table "${table_name}". It will be skipped.`,
obj
);
if (log_lvl) {
console.error(
`Object is missing a valid ID for table "${table_name}". It will be skipped. Checked keys: ${potential_keys.join(', ')}`,
obj
);
}
return undefined;
}