Skip to main content

apply_layout_backend_actions_queued

Function apply_layout_backend_actions_queued 

Source
fn apply_layout_backend_actions_queued(
    mstore: &Store,
    tab_id: &str,
    actions: &Value,
) -> Result<(), Box<dyn Error>>
Expand description

SPEC_864 Phase 4 — apply a LayoutBackendActionsQueued event: APPEND the reducer-validated actions to LayoutState.pendingbackendactions. The queue is a backend→frontend mailbox: the backend appends here; the frontend drains it by pushing a full slice without the processed actions (the REPLACE path in apply_layout_tree_replaced).

Idempotency: the event is applied twice on the happy path (sync in queue_layout_actions_via_reducer, again by the subscriber task consuming the broadcast), so actions whose actionid is already in the queue are skipped. Every writer stamps a fresh UUID per action; an (out-of-contract) empty actionid dedupes against other empties, which is the safe direction — skip rather than duplicate.