Files
mnote/bugs/07-ai/done/7-32-markdown-edit-page-body-save-missing-preconditions-v1.md
T
lix-2026 cdff672aa5 feat: align local-first workspace direction
Document the VSCode-like local-first product shape, demote Convex to a control-plane role, and retire stale architecture drafts.

Add local workspace migration/export references plus smoke coverage for no-Convex managed workspace startup, local markdown title/body/options persistence, asset upload behavior, and Convex fixture export.

Verification: git diff --cached --check; node scripts/check-local-first-convex-guard.js --staged; node scripts/task444-convex-workspace-export-local-fixture-smoke.js; node scripts/task166-local-first-managed-workspace-no-convex-smoke.js; node scripts/task167-local-markdown-title-body-options-no-convex-smoke.js
2026-05-19 08:11:58 +08:00

1.4 KiB
Raw Blame History

7-32 [done][bug] markdown_edit 直接 page.body.save 时丢失 revision / conflictDetectionKey v1

发现时间:2026-05-18

状态:[done]

关联主线:07-ai

1. 问题定义

7-27 后,在线 mnote.doc.markdown_edit 不再通过空 block_ops 写回,而是以最终 Markdown 生成 content 后直接执行 page.body.save

旧实现构造的写入 payload 只包含:

  • documentId
  • workspaceId
  • content
  • mode

没有携带当前 Page Aggregate 的 revisionconflictDetectionKey

2. 影响

AI markdown 主路径可能基于旧快照覆盖用户并发编辑,绕过 7-22 已补到 apply_block_ops 的写前置条件。

3. 修复

  • 在线 markdown_edit 写回前读取当前 Page Aggregate。
  • 构造 page.body.save payload 时带入:
    • /body/revision
    • /body/conflictDetectionKey
  • 新增回归测试检查 command artifact payload 中真实携带这两个字段。

4. 验证

RED

cargo test --manifest-path rust/Cargo.toml -p mnote-web hermes_tools_markdown_edit_online_page_body_save_carries_revision_conflict_key -- --nocapture

旧实现失败,artifact payload 中 revisionNull

GREEN

cargo test --manifest-path rust/Cargo.toml -p mnote-web hermes_tools_markdown_edit_online_page_body_save_carries_revision_conflict_key -- --nocapture

结果:1 passed