mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-12-05 19:25:00 +03:00
Move the editable block reconciler of `mcp.rs` into the new module `mcp/reconcile.rs` and remove redundant work from it: - Return early when a sequence has no old blocks and no new blocks. Leaf list items no longer allocate an empty nested reconcile state. - Use one `visited` set for all exact-index extractions. - The flavour phase now calls `apply_block_update_in_place` directly. An old block that the exact phase did not take cannot be equal to an unassigned new block, so the second extraction is unnecessary. The image update in `mutate_doc_body_delta` keeps the equality check. Add test-only work counters. A unit test rewrites 500 and 2,000 list items and makes sure that each old block is extracted once, that one sequence runs, that all block IDs stay the same, and that the work is linear. The 2,000-item integration test no longer measures wall-clock time. It now makes sure that the 2,000 list block IDs stay the same, that all items are in order, and that the size guard rejects a body above 1 MiB.