Skip to main content

Module object_helpers

Module object_helpers 

Source
Expand description

AgentMux-object read/update/meta primitives used by the object service handler, plus the per-agent zoom mirror. update_object_meta and schedule_agent_zoom_mirror are re-exported crate-wide.

Functions§

find_tab_for_layout 🔒
Phase E.4 (Option A) — reverse lookup: given a LayoutState.oid, find the Tab.oid that owns it (i.e., the tab whose layoutstate field matches). Returns None when the layout is unowned (legacy or partially-migrated row) or the mstore read fails — caller treats either as “skip the reducer dispatch and fall through to the wcore write.” Linear scan over all tabs; acceptable here because the layout-update path is low-frequency relative to drag-resize and the reducer mutex itself is held for sub-millisecond intervals.
get_object_by_oref 🔒
Resolve an “otype:oid” string to the corresponding wave object JSON.
schedule_agent_zoom_mirror 🔒
Mirror an agent block’s term:zoom into the per-agent ui:zoom content blob immediately (no debounce) so the zoom survives pane close even if the user closes the pane right after zooming. zoom = Some(z) upserts; zoom = None (term:zoom reset to null / 1.0) deletes the row so a default agent stores nothing. Writes are off-thread so the WebSocket handler stays non-blocking; SQLite serializes concurrent writes via the store mutex. See SPEC_AGENT_ZOOM_PERSISTENCE §4.3.
update_object 🔒
Update a wave object by replacing it wholesale in the store. The incoming value must have otype and oid fields. Matches Go’s ObjectService.UpdateObject behavior. Returns (otype, oid, updated_value_with_new_version) on success.
update_object_meta 🔒
Update object meta by oref string. Merges meta into existing object.