mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-23 05:16:23 -07:00
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:
@@ -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));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user