Commit 023221d
authored
refactor: frame bus + pipe mode tests (unified frame pipe follow-ups) (#725)
* test(runtimed): add pipe mode integration tests
Cover the unified pipe code paths that had zero test coverage:
- Sync frames forwarded with correct type byte prefix
- Only valid frame types piped (never Request/Response)
- Response frames consumed by request/response cycle, not piped
- Frame ordering preserved across rapid mutations
* refactor: replace webview.emit fan-out with in-memory frame bus
Introduce notebook-frame-bus.ts — a module-level pub/sub that replaces
the webview.emit('notebook:broadcast') and webview.emit('notebook:presence')
fan-out pattern. Subscribers now receive payloads via direct function
call instead of async Tauri event dispatch.
- useAutomergeNotebook: calls emitBroadcast/emitPresence instead of
webview.emit after WASM demux
- useDaemonKernel: subscribeBroadcast() replaces webview.listen
- useEnvProgress: subscribeBroadcast() replaces webview.listen
- usePresence: subscribePresence() replaces webview.listen
Only notebook:frame remains as a Tauri webview event (the relay pipe).
All downstream dispatch is synchronous and in-memory.
* test: strengthen pipe mode tests per Codex review
- Rename test_pipe_mode_forwards_broadcast_frames to
test_pipe_mode_only_pipes_allowed_frame_types — honest about what
it checks (type-byte filter, not broadcast-specific forwarding)
- Add comment noting broadcast frames require a kernel (E2E coverage)
- test_pipe_mode_preserves_frame_order now verifies:
- No duplicate frames (coalescing would violate ordering contract)
- Third client convergence (all 3 cells with correct sources)
* docs: note ordering test limitation per Codex review1 parent 5db3d83 commit 023221d
File tree
6 files changed
+738
-332
lines changed- apps/notebook/src
- hooks
- lib
- crates/runtimed/tests
6 files changed
+738
-332
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
219 | | - | |
220 | | - | |
| 220 | + | |
| 221 | + | |
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
| |||
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
267 | | - | |
268 | | - | |
269 | 268 | | |
270 | | - | |
271 | | - | |
272 | | - | |
| 269 | + | |
273 | 270 | | |
274 | 271 | | |
275 | 272 | | |
276 | 273 | | |
277 | | - | |
278 | 274 | | |
279 | | - | |
280 | | - | |
281 | | - | |
| 275 | + | |
282 | 276 | | |
283 | 277 | | |
284 | 278 | | |
| |||
0 commit comments