fix(dictionary): restore Anki proxy marker when Hachidori sync fails

- Revert the proxy marker to its previous value when every settings write attempt fails, so it no longer claims a server that was never written
- Add a test for the all-writes-fail path
- Retry Windows managed runtime cleanup in the test while bun.exe stays locked after exit
This commit is contained in:
2026-09-22 22:08:51 -07:00
parent d31a28c54f
commit c673b71053
3 changed files with 27 additions and 8 deletions
+13 -6
View File
@@ -372,12 +372,19 @@ test('Windows stages a new runtime version while the prior Bun executable is run
await exited;
}
}
cleanupOldWindowsManagedRuntimes({
platform: 'win32',
localAppData: root,
appVersion: '2.0.0',
});
assert.equal(fs.existsSync(path.dirname(first.bunPath)), false);
// Windows can keep bun.exe locked briefly after the exit event; cleanup
// skips locked runtimes, so retry the way the next launch would.
const firstDirectory = path.dirname(first.bunPath);
for (let attempt = 0; attempt < 30; attempt += 1) {
cleanupOldWindowsManagedRuntimes({
platform: 'win32',
localAppData: root,
appVersion: '2.0.0',
});
if (!fs.existsSync(firstDirectory)) break;
await new Promise((resolve) => setTimeout(resolve, 100));
}
assert.equal(fs.existsSync(firstDirectory), false);
assert.ok(fs.existsSync(expectedSecond.bunPath));
});