Skip to main content

mark_resume_failed

Function mark_resume_failed 

Source
pub fn mark_resume_failed(
    mstore: &Arc<Store>,
    event_bus: &Option<Arc<EventBus>>,
    block_id: &str,
)
Expand description

Mark that block_id’s --resume <sid> was rejected and the controller fell through to a fresh conversation. Best-effort — logs on failure but never panics, matching mark_active_pid’s contract. Called from persistent/stderr_reader.rs’s stderr reader the moment it detects the CLI’s “No conversation found with session ID” line, right alongside the existing core::persist_session_id(block_id, "", ...) clear.

Broadcasts waveobj:update on success: this fires while the user may be actively watching the pane that just lost its resume, so — unlike mark_active_pid/scan_orphans, both of which run before any frontend subscriber could be watching (spawn time / server boot) — the write must reach an already-open blockAtom live, not only on the pane’s next reload/reopen. Mirrors persist_session_id’s broadcast in core.rs. event_bus: None (tests / no live subscribers) silently skips the broadcast, matching every other call site’s contract.