Replan native history events across repeated traversal and redo invalidation

This commit is contained in:
2026-11-08 03:30:00 +08:00
parent 231f70d87d
commit 1b29b0138b
8 changed files with 151 additions and 14 deletions
+2 -2
View File
@@ -78,9 +78,9 @@ test('recovery publication failure keeps one plan and blocks sends until the exa
f.broken=false;await session.resolve(plan);await engine.settle();assert.equal(f.calls.length,2);assert.ok(engine.getDurability().durableRootRevision>revision);assert.equal(engine.getSnapshot().runtime.recoveries.size,1);await engine.close();
});
test('incomplete choices and mixed user/traversal recovery require explicit handling',async()=>{
test('incomplete choices reject while recorded user/traversal recovery can be planned',async()=>{
const f=fixture(),engine=await f.open();title(engine,'local');await engine.settle();const session=await engine.prepareRecovery();assert.throws(()=>session.plan(new Map()),/recovery_choices_incomplete/);await session.cancel();
assert.equal(engine.editor.history.undo().status,'applied');await engine.settle();const undoSession=await engine.prepareRecovery();assert.throws(()=>undoSession.plan(choices(engine)),/recovery_history_mixed_traversal_not_supported/);await undoSession.cancel();await engine.close();
assert.equal(engine.editor.history.undo().status,'applied');await engine.settle();const undoSession=await engine.prepareRecovery();assert.ok(undoSession.plan(choices(engine)).history.redo.length===1);await undoSession.cancel();await engine.close();
});
test('retirement rejects unknown work and incomplete dependency closures without mutation',()=>{