Skip to main content

is_settings_file_event

Function is_settings_file_event 

Source
fn is_settings_file_event(event: &FsWatchEvent) -> bool
Expand description

Whether a raw fs_watch event refers to a settings.json save specifically — the pool’s broadcast stream carries events for every currently-watched path in the process, not just this module’s. Matches the pre-migration code’s filter exactly: filename must be settings.json (was event.paths.iter().any(|p| p.ends_with("settings.json"))) AND the event must be a Create/Modify (was EventKind::Modify(_) | EventKind::Create(_)). A Removed event (external delete, or an editor’s unlink+recreate save) is deliberately excluded — read_config_file treats a missing file as success (defaults, no errors), so reacting to Remove would reset the live config and broadcast it to every client.