fix: apply_mpack refuses commits when their snapshot is absent from mpack and store
When wire_fetch returns snaps=0 for a commit, apply_mpack was still writing the commit to the local store. On retry the commit is in `have`, the server returns nothing new, and pull aborts with 'snapshot missing' indefinitely.
Fix: before writing a commit, verify its snapshot is either in written_snapshot_ids (received in this mpack) or already in the local store. If neither, skip the commit with a warning. The next pull re-requests the commit without it in `have`, and the server sends it together with its snapshot.
Four tests in TestApplyMpackMissingSnapshotGuard cover: - commit refused when snapshot absent from mpack and store (regression) - second apply with snapshot succeeds after first was refused - commit written when snapshot already in local store (no false positive) - happy path: both commit and snapshot in same mpack
Semantic Changes
8 symbols
0 comments
muse hub commit comment sha256:2c59968e5fd34f1740180d630338fddfb8c465b71e150a0965f11dbdcba5dec7 --body "your comment"
No comments yet. Be the first to start the discussion.