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

@@ -20,6 +20,7 @@ export async function load_ae_obj_id__event({
event_id,
view = 'default',
inc_device_li = false,
inc_file_li = false,
inc_location_li = false,
inc_session_li = false,
inc_template_li = false,
@@ -30,6 +31,7 @@ export async function load_ae_obj_id__event({
event_id: string;
view?: string;
inc_device_li?: boolean;
inc_file_li?: boolean;
inc_location_li?: boolean;
inc_session_li?: boolean;
inc_template_li?: boolean;
@@ -45,7 +47,7 @@ export async function load_ae_obj_id__event({
if (log_lvl) console.log('Browser is offline. Skipping API and attempting cache load.');
ae_promises.load__event_obj = await db_events.event.get(event_id);
if (ae_promises.load__event_obj) {
return await _handle_nested_loads(ae_promises.load__event_obj, { api_cfg, inc_device_li, inc_location_li, inc_session_li, inc_template_li, log_lvl });
return await _handle_nested_loads(ae_promises.load__event_obj, { api_cfg, inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li, log_lvl });
}
return null;
}
@@ -97,13 +99,13 @@ export async function load_ae_obj_id__event({
return null;
}
return await _handle_nested_loads(ae_promises.load__event_obj, { api_cfg, inc_device_li, inc_location_li, inc_session_li, inc_template_li, log_lvl });
return await _handle_nested_loads(ae_promises.load__event_obj, { api_cfg, inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li, log_lvl });
}
/**
* Shared logic for loading nested child collections
*/
async function _handle_nested_loads(event_obj: any, { api_cfg, inc_device_li, inc_location_li, inc_session_li, inc_template_li, log_lvl }: any) {
async function _handle_nested_loads(event_obj: any, { api_cfg, inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li, log_lvl }: any) {
const current_event_id = event_obj.event_id_random || event_obj.event_id || event_obj.id;
if (inc_device_li) {
@@ -114,6 +116,16 @@ async function _handle_nested_loads(event_obj: any, { api_cfg, inc_device_li, in
log_lvl
});
}
if (inc_file_li) {
event_obj.event_file_li = await load_ae_obj_li__event_file({
api_cfg,
for_obj_type: 'event',
for_obj_id: current_event_id,
enabled: 'all',
limit: 100,
log_lvl
});
}
if (inc_location_li) {
event_obj.event_location_obj_li = await load_ae_obj_li__event_location({
api_cfg,

View File

@@ -5,6 +5,7 @@ import { db_save_ae_obj_li__ae_obj } from '$lib/ae_core/core__idb_dexie';
import { db_events } from '$lib/ae_events/db_events';
import type { ae_EventLocation } from '$lib/types/ae_types';
import { load_ae_obj_li__event_file } from '$lib/ae_events/ae_events__event_file';
import { load_ae_obj_li__event_session } from '$lib/ae_events/ae_events__event_session';
const ae_promises: key_val = {};