From d300825312f37688b1894e0db58d0ba53d95d246 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 10 Feb 2026 18:38:39 -0500 Subject: [PATCH] fix(sync): restrict room refreshes to selected session to prevent flickering - Optimized background API refreshes to focus on the selected session instead of the entire room.\n- Eliminated redundant bulk database writes that were causing UI flickering during refresh cycles.\n- Staggered initial data fetches to prevent API request storms.\n- Added detailed logging for easier tracing of background sync operations. --- .../launcher_background_sync.svelte | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/routes/events/[event_id]/(launcher)/launcher_background_sync.svelte b/src/routes/events/[event_id]/(launcher)/launcher_background_sync.svelte index c48af058..02918589 100644 --- a/src/routes/events/[event_id]/(launcher)/launcher_background_sync.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher_background_sync.svelte @@ -134,6 +134,7 @@ const location_id = $events_slct.event_location_id; if (!location_id) return; try { + if (log_lvl > 1) console.log(`Sync: Refreshing sessions for location: ${location_id}`); await events_func.load_ae_obj_li__event_session({ api_cfg: $ae_api, for_obj_type: 'event_location', @@ -146,16 +147,17 @@ } /** - * API Refresh: Presentations in Room + * API Refresh: Presentations for Selected Session */ async function refresh_presentation_data() { - const location_id = $events_slct.event_location_id; - if (!location_id) return; + const session_id = $events_slct.event_session_id; + if (!session_id) return; try { + if (log_lvl > 1) console.log(`Sync: Refreshing presentations for session: ${session_id}`); await events_func.load_ae_obj_li__event_presentation({ api_cfg: $ae_api, - for_obj_type: 'event_location', - for_obj_id: location_id, + for_obj_type: 'event_session', + for_obj_id: session_id, try_cache: true, log_lvl: 0 }); @@ -163,16 +165,17 @@ } /** - * API Refresh: Presenters in Room + * API Refresh: Presenters for Selected Session */ async function refresh_presenter_data() { - const location_id = $events_slct.event_location_id; - if (!location_id) return; + const session_id = $events_slct.event_session_id; + if (!session_id) return; try { + if (log_lvl > 1) console.log(`Sync: Refreshing presenters for session: ${session_id}`); await events_func.load_ae_obj_li__event_presenter({ api_cfg: $ae_api, - for_obj_type: 'event_location', - for_obj_id: location_id, + for_obj_type: 'event_session', + for_obj_id: session_id, try_cache: true, log_lvl: 0 });