fix: protect View config recovery (#612)

Issue: #612
User-Visible: yes
This commit is contained in:
Claude
2026-09-23 10:34:09 +03:00
parent 78698a075a
commit 2cfb6d2169
51 changed files with 569 additions and 446 deletions
+23
View File
@@ -0,0 +1,23 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { recoverConfigWriteConflict } from '../test-build/config-write-conflict.js';
test('#612 AC1: a View conflict reloads without an editor runtime or exception', async () => {
const events = [];
assert.doesNotThrow(() => recoverConfigWriteConflict(null, () => {
events.push('reload');
}));
assert.deepEqual(events, ['reload']);
});
test('#612: an editor conflict cancels its draft before reloading', () => {
const events = [];
recoverConfigWriteConflict(
{ _cancelPath: () => events.push('cancel') },
() => { events.push('reload'); },
);
assert.deepEqual(events, ['cancel', 'reload']);
});