Skip to main content

apply_srv_window_closed

Function apply_srv_window_closed 

Source
pub(crate) fn apply_srv_window_closed(
    mstore: &Store,
    window_id: &str,
) -> Result<(), Box<dyn Error>>
Expand description

Phase E.5 — delete the persisted Window row + remove the id from Client.windowids. Mirrors wcore::close_window’s order: prune client.windowids FIRST (so any read between the two ops doesn’t see a dangling id), then delete the Window row. (codex P1 #619.)

pub(crate): besides the SrvWindowClosed subscriber arm, the CloseWindow handler calls this directly on its divergence path — when the reducer never knew the window (silent no-op, no event) but the store still holds it (#2051). Deliberately defensive/idempotent: both callers rely on the already-gone cases being safe.