Resolved
Two fixes applied in PR #616:
- Stream corruption (original bug): Buffered outgoing pipe frames in a
VecDeque, flushed before select!
- Output rendering: Re-enabled broadcast-driven output (
onOutput: appendOutput) since Automerge sync doesn't deliver changes in pipe mode (changed=false on all frames — see sync state mismatch below)
Remaining: Sync state mismatch (follow-up)
The daemon's Automerge sync state tracks the relay peer (established during do_initial_sync), but in pipe mode the actual consumer is the WASM (which has its own sync::State). All sync frames arrive with changed=false because the sync protocol is talking to the wrong peer.
This means:
- Outputs render via broadcasts only (the workaround), not via sync
- The WASM doc doesn't get incremental updates from the daemon after execution
- Reopening the app loads correct state (from
GetDocBytes at bootstrap)
The proper fix: skip do_initial_sync in pipe mode and let the WASM handle the full sync protocol with the daemon through the pipe. See .context/plans/fix-pipe-mode-sync-state.md for the full design.