Files
mnote/bugs/05-editor-mainline/process/5-18-ai-write-body-does-not-sync-page-aggregate-content-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.6 KiB

5-18 [process][bug] AI 写正文后本地 Page Aggregate content 可能不刷新 v1

发现时间:2026-05-17

状态:[process]

关联主线:05-editor-mainline

1. 问题定义

页面 AI 写正文后,前端本地 Page Aggregate state 只更新 persisted meta,不保证同步正文快照。editorBridge.replaceWithSnapshot 在 editor host 内派发 runtime command,但没有直接回写 reducer content。

2. 证据

3. 影响

  • 用户连续两次问 AI 时,第二次 AI context 可能仍读旧 pageClientState.content
  • 编辑器显示与 Page Aggregate reducer 状态不一致。
  • AI 写入验收如果只看编辑器 DOM,可能漏掉 context stale 问题。

4. 建议修复

  • AI 写入成功后应触发 Page Aggregate 回读或统一 reducer content 更新。
  • AI context 应从最新 Rust Page Aggregate snapshot 读取,而不是依赖可能过期的本地 reducer。
  • 增加 smoke:AI 修改正文后不刷新页面连续再问一次 AI,断言第二次 context 包含新内容。

5. 状态

已确认 AI 写入后本地 Page Aggregate content 可能滞后,尚未修复。