From 86201f0fc1852632416d077a4c6b207b78527506 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 21 May 2026 22:29:13 -0400 Subject: [PATCH] feat(launcher): implement force-sync and chronological download priority Onsite operators can now manually trigger a full pre-sync of all location materials via a "Force Sync Location" button in the Launcher config. This ensures podium Macs have all content cached before an event starts. - Added trigger__force_location_sync to launcher session store. - Implemented force_location_sync() in background sync engine to perform recursive metadata fetches for all sessions in a location. - Optimized download queue with a 4-tier chronological sort: 1. Event/Location assets (Global) 2. Sessions by start time (Earliest first) 3. Presentations by start time (Sequential order) 4. File creation date (First-in fairness for on-time uploads) - Updated module and native integration documentation. Co-Authored-By: Claude Sonnet 4.6 --- .ae_brief | 15 +--- .../MODULE__AE_Events_PressMgmt_Launcher.md | 16 +++- ...__AE_Events_Launcher_Native_integration.md | 13 ++- .../ae_events_stores__launcher_defaults.ts | 5 ++ .../launcher_cfg_sync_timers.svelte | 14 ++- .../launcher_background_sync.svelte | 86 ++++++++++++++++++- 6 files changed, 129 insertions(+), 20 deletions(-) diff --git a/.ae_brief b/.ae_brief index 2cbc2799..af7e7a5b 100644 --- a/.ae_brief +++ b/.ae_brief @@ -1,22 +1,15 @@ # Aether Project Brief: aether_app_sveltekit -**Last Updated:** 2026-02-09 22:03:56 +**Last Updated:** 2026-05-21 22:25:05 **Current Agent:** mcp_agent ## 🛠️ What I Just Did -Addressed multiple Svelte compiler warnings: -1. Converted ~30 decorative labels to spans (a11y). -2. Applied Svelte 5 untrack() pattern to initial state from props. -3. Fixed CSS scoping for TipTap editor. -4. Added rel="noopener noreferrer" to external links. -5. Commited changes in two atomic batches. +Implemented "Force Sync Location" feature. Optimized file download order with a 4-tier chronological sort (Global > Session > Presentation > Creation Date). Added UI button for onsite operators. Updated project documentation. Verified with npm run check. ## 🚧 Current Blockers -None. Remaining svelte-check warnings (219) require more granular ID/for linking in complex forms. +None. ## ➡️ Exact Next Steps -1. Granular fix for remaining 68 label/ID associations in address/person forms. -2. Systematic application of untrack() for remaining state-from-props warnings. -3. Clean up unused TipTap CSS selectors identified by svelte-check. +User to review changes. Ready for onsite testing/deployment. --- *Generated by ae_brief* diff --git a/documentation/MODULE__AE_Events_PressMgmt_Launcher.md b/documentation/MODULE__AE_Events_PressMgmt_Launcher.md index e722c81f..761ec16b 100644 --- a/documentation/MODULE__AE_Events_PressMgmt_Launcher.md +++ b/documentation/MODULE__AE_Events_PressMgmt_Launcher.md @@ -169,8 +169,8 @@ per event via config. 1. **Presenter checks in** — staff looks up their session(s) in Pres Mgmt 2. **File upload** — staff or presenter uploads file to the correct presenter/session record 3. **File verification** — staff opens the file on a practice station to confirm it renders -4. **Launcher sync** — file appears in the Launcher within the next polling cycle -5. **Presenter proceeds to room** — podium kiosk already has the file cached +4. **Launcher Sync** — file appears in the Launcher within the next polling cycle. Staff can use the **Force Sync Location** button in the Launcher config to immediately queue all files for the room's schedule. +5. **Presenter proceeds to room** — podium kiosk already has the file cached. --- @@ -280,6 +280,18 @@ For production onsite use, **Native mode on Mac laptops** is the target. The Ele app pre-caches all session files in the background so presentations open instantly without a network round-trip at the moment of launch. +### Download Priority & Room Readiness + +To ensure the podium is ready for the day's first sessions, the Launcher sync engine uses a +4-tier chronological sorting priority: + +1. **Global Assets:** Event and Location level files (branding, walk-in slides) are cached first. +2. **Session Schedule:** Files for the earliest sessions in the room are prioritized. +3. **Presentation Order:** Within a session block, speakers are prioritized by their scheduled start time. +4. **First-In Fairness:** When times are equal, older uploads are prioritized over late revisions. + +Operators can manually trigger a full pre-sync of all location materials via the **Force Sync Location** button in the Launcher configuration (Sync Engine section). + ### Native Mode — Electron App - **Repo:** `~/OSIT_dev/aether_app_native_electron/` diff --git a/documentation/PROJECT__AE_Events_Launcher_Native_integration.md b/documentation/PROJECT__AE_Events_Launcher_Native_integration.md index 21d880ed..df4ee945 100644 --- a/documentation/PROJECT__AE_Events_Launcher_Native_integration.md +++ b/documentation/PROJECT__AE_Events_Launcher_Native_integration.md @@ -72,10 +72,15 @@ Files are stored persistently using their SHA-256 hash to prevent filename colli - **Filename:** `{hash}.file` ### 4.2 Background Sync (File Warming) -When a user navigates to a session in the Launcher UI, the `LauncherBackgroundSync` component: -1. Extracts all `event_file_id` values for that session. -2. Checks the native cache via `aetherNative.check_cache`. -3. Triggers background downloads for missing files via `aetherNative.download_to_cache`. +When a user navigates to a session in the Launcher UI, the `LauncherBackgroundSync` component warms the cache for that specific session. To ensure full room readiness, a **Force Sync Location** trigger is available in the configuration UI. + +1. **Metadata Fetch:** The system fetches all sessions, presentations, and presenters for the current location into the local database (Dexie). +2. **Chronological Priority:** Missing files are added to the download queue and sorted to prioritize the event schedule: + - **Tier 1: Global Assets** — Event and Location level files (virtual time 0). + - **Tier 2: Session Schedule** — Earliest sessions are prioritized first. + - **Tier 3: Presentation Order** — Within a session, speakers are prioritized by their start time. + - **Tier 4: Integrity & Fairness** — Tie-breakers use `created_on` (oldest first) to ensure on-time uploads are cached before last-minute revisions. +3. **Download:** Triggers background downloads via `aetherNative.download_to_cache` sequentially to preserve network bandwidth and ensure file integrity. ### 4.3 Safe Handover (Launch Sequence) When a user clicks "Open", the system follows a non-destructive sequence: diff --git a/src/lib/stores/ae_events_stores__launcher_defaults.ts b/src/lib/stores/ae_events_stores__launcher_defaults.ts index 22bb6e0c..d93783d9 100644 --- a/src/lib/stores/ae_events_stores__launcher_defaults.ts +++ b/src/lib/stores/ae_events_stores__launcher_defaults.ts @@ -119,6 +119,9 @@ export interface LauncherSessState { trigger_reload__event_session_obj_li: string | null; trigger_reload__event_location_obj_id: string | null; trigger_reload__event_location_obj_li: string | null; + + trigger__force_location_sync: any; + trigger__ws_connect: any; trigger__ws_disconnect: any; } @@ -254,6 +257,8 @@ export const launcher_sess_defaults: LauncherSessState = { trigger_reload__event_location_obj_id: null, trigger_reload__event_location_obj_li: null, + trigger__force_location_sync: null, + trigger__ws_connect: null, trigger__ws_disconnect: null }; diff --git a/src/routes/events/[event_id]/(launcher)/cfg_components/launcher_cfg_sync_timers.svelte b/src/routes/events/[event_id]/(launcher)/cfg_components/launcher_cfg_sync_timers.svelte index fc34063b..c7e9e694 100644 --- a/src/routes/events/[event_id]/(launcher)/cfg_components/launcher_cfg_sync_timers.svelte +++ b/src/routes/events/[event_id]/(launcher)/cfg_components/launcher_cfg_sync_timers.svelte @@ -1,8 +1,8 @@