fix(sync): 跨工作区重启保留重试与暂停状态

This commit is contained in:
2026-09-08 19:58:39 +08:00
parent 5c995e66be
commit 9e295b9a5d
7 changed files with 227 additions and 50 deletions
@@ -62,3 +62,12 @@ it('requires a reviewed merge fingerprint and invalidates preview when the remot
expect(hostInvoke).toHaveBeenCalledWith('sync_bind', { request: { vault_id: 'local', endpoint: 'https://test.example/', account: 'test', remote_vault: 'one', mode: 'merge', fingerprint: 'reviewed-snapshot' } })
wrapper.unmount()
})
it('shows a persisted halt without suggesting an automatic retry countdown', async () => {
vi.mocked(hostInvoke).mockResolvedValue({ ...empty(), binding: { id: 'binding', endpoint: 'https://test.example/', account: 'test', remote_vault: 'remote', cursor: 7 }, halted: true, failures: 3, error: 'UNAUTHORIZED', retry_in: 120 })
const wrapper = mount(SyncSettings); await flushPromises()
expect(wrapper.text()).toContain('自动同步已停止')
expect(wrapper.text()).toContain('UNAUTHORIZED')
expect(wrapper.text()).not.toContain('120s')
wrapper.unmount()
})