Skip to main content

apply_srv_window_closed

Function apply_srv_window_closed 

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

Phase E.5 — remove the id from Client.windowids, then delete the persisted Window row, in one transaction. Pruning FIRST means any read between the two ops doesn’t see a dangling id. (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.