mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 16:03:49 +00:00
fix(codex): retry reconciliation registry writes
This commit is contained in:
@@ -80,4 +80,16 @@ describe('CodexPaneAccountRegistryMutations', () => {
|
||||
expect(write).toHaveBeenCalledTimes(2)
|
||||
expect(vi.getTimerCount()).toBe(0)
|
||||
})
|
||||
|
||||
it('retries a failed reconciliation write without a pending pane mutation', async () => {
|
||||
const registry = parseRegistry(JSON.stringify({ version: 2, panes: { existing: EXISTING } }))
|
||||
const write = vi.fn().mockReturnValueOnce(false).mockReturnValueOnce(true)
|
||||
const mutations = new CodexPaneAccountRegistryMutations({ read: () => registry, write })
|
||||
|
||||
mutations.persistReconciliation(registry, true)
|
||||
await vi.advanceTimersByTimeAsync(100)
|
||||
|
||||
expect(write).toHaveBeenCalledTimes(2)
|
||||
expect(vi.getTimerCount()).toBe(0)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -34,7 +34,7 @@ export class CodexPaneAccountRegistryMutations {
|
||||
}
|
||||
|
||||
flush(): void {
|
||||
if (this.pending.size === 0) {
|
||||
if (this.pending.size === 0 && !this.needsPersistence) {
|
||||
this.clearRetryState()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user