Files
mnote/bugs/03-rust-web/process/3-18-ws-sse-delta-contract-split-v1.md
T
lix-2026 3311bd0366 chore: document architecture gaps and add dev hot reload
- add npm dev:hot wrapper using cargo-watch and page reload polling

- add mnote-web dev hot reload endpoint and coverage

- record current architecture review and tracked bug findings across realtime, tree, editor, and AI runtimes

Verification:

- node scripts/task-dev-hot-plan-test.js

- node --check scripts/dev-hot.js

- cargo test -p mnote-web dev_hot -- --nocapture
2026-05-17 23:09:56 +08:00

1.3 KiB
Raw Blame History

3-18 [process][bug] WS 与 SSE delta 载荷合同分裂 v1

发现时间:2026-05-17

状态:[process]

关联主线:03-rust-web

1. 问题定义

SSE polling 可以从 bridgeLogs / domainEvents 解析 streamDelta 并附带 snapshot / resync 信息;WS 当前广播的是 command_committed 外壳,两者不是同一套 delta 合同。

2. 证据

3. 影响

  • 同一 tree command 在 WS 与 SSE 下可能给客户端不同结构。
  • 前端 live cache 需要维护两套 reducer,增加状态分裂风险。
  • WS 切主时,SSE 已覆盖的 snapshot/resync 语义可能丢失。

4. 建议修复

  • 抽出统一的 tree realtime envelopeWS 与 SSE 只作为 transport。
  • 对同一命令分别跑 WS / SSE 合同测试,断言事件 kind、cursor、snapshot、resync 语义一致。
  • 前端 reducer 只消费统一 envelope,不感知 transport 差异。

5. 状态

已确认 WS / SSE 事件结构不统一,尚未修复。