mirror of
https://github.com/stablyai/orca.git
synced 2026-11-02 10:08:13 +00:00
Refresh only actual on-screen review cards and the selected visible review panel, with a single metadata owner per execution host. Open reviews refresh every 60 seconds when selected and 120 seconds otherwise. Settled merged reviews stop automatic refresh; pending merged checks continue, hidden rows stop, and work changes or stale re-exposure discover fresh state. Remove the polling setting. Preserve provider/SSH/runtime ownership, mixed-version cache behavior, failure backoff, bounded foreground admission, request coalescing, and mutation invalidation. Cover older persisted caches and unknown HEADs. Validated with 1,628 focused tests, typechecking, lint/code-quality gates, hidden Electron viewport checks, and parallel Codex/Claude Opus 5.5 adversarial reviews. Measurements and policy details are in PR #25788. Fixes #25746 Co-authored-by: ggbdpq <ggbdpq@gmail.com>
30 lines
1.2 KiB
TypeScript
30 lines
1.2 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { REVIEW_REFRESH_COOLDOWN_MS, reviewRefreshIntervalMs } from './review-refresh-policy'
|
|
|
|
describe('review refresh intervals', () => {
|
|
it.each([
|
|
[{ state: 'open', selected: true }, 60_000],
|
|
[{ state: 'open', selected: false }, 120_000],
|
|
[{ state: 'draft', selected: true }, 60_000],
|
|
[{ state: 'draft' }, 120_000],
|
|
[{ state: 'merged', checksStatus: 'pending' }, 60_000],
|
|
[{ state: 'merged', checksStatus: null }, 60_000],
|
|
[{ state: 'merged' }, 60_000],
|
|
[{ state: 'merged', checksStatus: 'success' }, null],
|
|
[{ state: 'merged', checksStatus: 'failure' }, null],
|
|
[{ state: 'merged', checksStatus: 'neutral' }, null],
|
|
[{ state: 'closed', selected: true }, 900_000],
|
|
[{ state: 'closed' }, 900_000],
|
|
[{ hasReview: false, selected: true }, 60_000],
|
|
[{ hasReview: false }, 900_000],
|
|
[{ state: 'open', checksStatus: 'success' }, 120_000],
|
|
[{ state: 'open', checksStatus: 'failure', selected: true }, 60_000]
|
|
] as const)('uses %j → %s', (input, expected) => {
|
|
expect(reviewRefreshIntervalMs(input)).toBe(expected)
|
|
})
|
|
|
|
it('keeps exposure cooldown separate from periodic refresh cadence', () => {
|
|
expect(REVIEW_REFRESH_COOLDOWN_MS).toBe(10_000)
|
|
})
|
|
})
|