fix(cordis): make config reload transactional

This commit is contained in:
Tianyi Cui
2026-07-30 03:11:16 +08:00
parent f8eb6a9b84
commit 195f7fa9af
33 changed files with 1020 additions and 268 deletions
@@ -61,11 +61,9 @@ export async function apply(ctx: Context): Promise<void> {
// nothing is left to unmount or await then.
const entry = ctx.loader.store[id]
if (entry === undefined) return
const fiber = entry.fiber
ctx.loader.remove(id)
// remove() only starts the fiber's dispose; join it so the chooser's
// unload signals completion only after the backend quiesced.
await fiber?.dispose()
// remove() disposes the entry transactionally, so the chooser's unload
// signals completion only after the backend quiesced.
await ctx.loader.remove(id)
}
}, 'directory-picker-auto: backend entry')
}