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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user