diff --git a/src/routes/events/ae_comp__event_files_upload.svelte b/src/routes/events/ae_comp__event_files_upload.svelte index 97a0ee1a..64963105 100644 --- a/src/routes/events/ae_comp__event_files_upload.svelte +++ b/src/routes/events/ae_comp__event_files_upload.svelte @@ -24,7 +24,6 @@ import { events_trig } from '$lib/stores/ae_events_stores'; import { events_func } from '$lib/ae_events/ae_events_functions'; -import { db_events } from '$lib/ae_events/db_events'; interface Props { log_lvl?: number; @@ -110,9 +109,13 @@ async function handle_submit_form_files(event: SubmitEvent) { $events_sess.files.processed_file_list = []; target.reset(); - // Refresh Local Cache (Optimistic Revalidation) - await db_events.file.clear(); - events_func.load_ae_obj_li__event_file({ + // Refresh the file list for this object only. + // WHY: Previously used db_events.file.clear() here, which nuked the ENTIRE + // file table in Dexie. Every liveQuery watching any file list would immediately + // show 0 results, and only this object's files were reloaded. Files for all + // other objects (locations, sessions, presenters) remained missing until their + // own background syncs fired. Targeted reload avoids that side effect. + await events_func.load_ae_obj_li__event_file({ api_cfg: $ae_api, for_obj_type: link_to_type, for_obj_id: link_to_id,