feat(canvas): batch mutable document operations with durable coverage
This commit is contained in:
@@ -204,3 +204,19 @@ test('complete recovery reads reject same-version rewrites and lifecycle regress
|
||||
assert.throws(()=>validateCanonicalRead(original,new Map([['canvas',1]]),withTombstone,new Map([['canvas',1]]),registry),/canonical_version_mismatch/);
|
||||
await engine.close();
|
||||
});
|
||||
|
||||
test('one transaction captures the first presence baseline even when its created element is later deleted', async () => {
|
||||
const storage = storageFixture(), port = persistenceFixture(), { engine } = await open(storage, port);
|
||||
try {
|
||||
const node = { ...original.elements.get('a'), id: 'temporary' };
|
||||
const result = engine.editor.transaction(tx => {
|
||||
tx.dispatch({ type: 'element.create', element: node });
|
||||
tx.dispatch({ type: 'element.remove', target: { id: node.id, incarnation: 1 } });
|
||||
});
|
||||
assert.equal(result.status, 'applied'); assert.equal(result.operationIds.length, 1);
|
||||
const operation = engine.getSnapshot().runtime.ledger.operations.get(result.operationIds[0]);
|
||||
assert.equal(operation.basePresence.temporary, 'absent');
|
||||
assert.equal(engine.getSnapshot().document.tombstones.get(node.id), 1);
|
||||
await engine.settle(); assert.equal(port.calls.length, 1);
|
||||
} finally { await engine.close(); }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user