mirror of
https://github.com/stablyai/orca.git
synced 2026-10-16 16:03:26 +00:00
Test dropping visit timestamps for removed runtime repos
Verify that removing an unhydrated runtime repository successfully drops its associated worktree entries from the persisted visit history.
This commit is contained in:
@@ -688,6 +688,39 @@ describe('repo slice runtime routing', () => {
|
||||
expect(reposRemove).toHaveBeenCalledWith({ repoId: sshRepo.id })
|
||||
})
|
||||
|
||||
it('drops persisted visit timestamps for removed unhydrated runtime repos', async () => {
|
||||
runtimeEnvironmentCall.mockResolvedValue({
|
||||
id: 'rpc-remove-runtime-unhydrated',
|
||||
ok: true,
|
||||
result: { removed: true },
|
||||
_meta: { runtimeId: 'runtime-remote' }
|
||||
})
|
||||
const store = createTestStore()
|
||||
const remoteWorktreeId = `${remoteRepo.id}::/srv/orca/wt`
|
||||
const localWorktreeId = `${localRepo.id}::/local/wt`
|
||||
store.setState({
|
||||
settings: { activeRuntimeEnvironmentId: 'env-1' } as never,
|
||||
repos: [remoteRepo, localRepo],
|
||||
activeRepoId: remoteRepo.id,
|
||||
lastVisitedAtByWorktreeId: {
|
||||
[remoteWorktreeId]: 100,
|
||||
[localWorktreeId]: 200
|
||||
}
|
||||
})
|
||||
|
||||
await store.getState().removeProject(remoteRepo.id)
|
||||
|
||||
expect(store.getState().repos).toEqual([localRepo])
|
||||
expect(store.getState().lastVisitedAtByWorktreeId).toEqual({ [localWorktreeId]: 200 })
|
||||
expect(runtimeEnvironmentCall).toHaveBeenCalledWith({
|
||||
selector: 'env-1',
|
||||
method: 'repo.rm',
|
||||
params: { repo: remoteRepo.id },
|
||||
timeoutMs: 15_000
|
||||
})
|
||||
expect(reposRemove).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('evicts GitHub caches for removed repos using repo id and legacy path keys', async () => {
|
||||
const store = createTestStore()
|
||||
store.setState({
|
||||
|
||||
Reference in New Issue
Block a user