fix(desktop): add 10s timeout to connection-ipc fetches#92
Merged
Conversation
The three IPC handlers (`connection:v1:test`, `models:v1:list`, `connection:v1:test-active`) called `fetch` with no AbortSignal, so an unreachable or slow baseUrl would pin the renderer's "Test connection" spinner indefinitely. Wrap each call in a `fetchWithTimeout` helper backed by AbortController (default 10s) and surface AbortError as a clear NETWORK hint. Adds a unit test covering the abort path.
Contributor
There was a problem hiding this comment.
Findings
- No issues found in added/modified lines with >=80% confidence.
Summary
- Review mode: initial
- No blocker/major/minor/nit issues found in the latest diff.
- Hard-constraint checks in this diff: no new dependencies (license/size impact not introduced), no direct provider SDK imports, no UI token hardcoding touched, and no silent fallback added (errors are surfaced with explicit code/message/hint).
docs/VISION.mdanddocs/PRINCIPLES.md: Not found in repo/docs.- Residual risk: timeout handling is unit-tested via
fetchWithTimeout, but there is no integration-style IPC test in this diff proving timeout classification/hints across all three handlers.
Testing
- Not run (automation)
open-codesign Bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fetchcalls (connection:v1:test,models:v1:list,connection:v1:test-active) in afetchWithTimeouthelper backed byAbortController(default 10s).fetchand asserts the abort fires.Why
Without an
AbortSignal, an unreachable or slowbaseUrlwould pin the renderer's "Test connection" spinner indefinitely (no main-side timeout, no Node-default fetch timeout). 10s is well above the <1s normal /models latency but short enough that the UI fails fast.PRINCIPLES §5b
CONNECTION_FETCH_TIMEOUT_MSexported as a single source of truthTest plan
pnpm --filter @open-codesign/desktop exec vitest run src/main/connection-ipc.test.ts— 41/41 pass (incl. new fetchWithTimeout abort test)pnpm typecheck— greenpnpm lint— 0 errors (pre-existing complexity warnings unrelated)