Skip to content

Give CLI package queries two minutes and name the timeout when it fires - #5583

Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/ipc-package-query-timeout
Oct 23, 2026
Merged

Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/ipc-package-query-timeout

Conversation

@GabrielDuf

@GabrielDuf Gabriel Dufresne (GabrielDuf) commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
  • I have read the contributing guidelines, and I agree with the Code of Conduct.
  • Have you checked that there aren't other open pull requests for the same changes?
  • Have you tested that the committed code can be executed without errors?
  • Have you confirmed that this issue is caused by UniGetUI itself, and not by the package manager or the package involved?

Why

cli-headless-e2e fails intermittently on the Windows jobs and passes on re-run, always with:

CLI command failed (1): package search --manager npm --query cowsay --max-results 20
{ "status": "error", "command": "", "message": "The operation was canceled." }

(or the same on package details --manager npm). That message is not npm's: it is the CLI's own client-side timeout. IpcClient.GetRequestTimeout gave every GET /packages/* request 30 s. In green Windows runs npm search takes 1–7 s and npm details 6–15 s; in the failing runs the daemon log shows the npm request starting and never finishing before the job ends. Every failure in the last 8 failed runs was a Windows npm search/details call. Users on a slow network hit the same limit through the CLI.

What changed (IpcClient.cs)

  • Read-only package queries (GET /packages/*: search, details, versions, installed, updates) now get 2 minutes instead of 30 s. Package actions keep their 5 minutes.
  • When the client's own deadline fires, it now throws a TimeoutException naming the request and the limit (UniGetUI did not answer GET …/packages/search within 120 seconds.) instead of surfacing the bare The operation was canceled., which read like a cancelled package operation. The CLI exit code stays 1.
  • TimeoutException was added to IsConnectivityException, so the /status probe and registration liveness checks still treat a timeout as an unreachable endpoint.
  • The response body read now also observes the deadline.

Notes for reviewers

  • The last Linux cancellation (4 September, package repair --manager npm) is a different case: that POST already has 5 minutes and normally takes ~1 s. With this change a client timeout and a server-reported cancelled operation are now distinguishable in the output.
  • There is no unit test for the timeout path: IpcClient can only be constructed against a registered daemon. The 49 existing IPC tests pass, and both dotnet format passes are clean.

🤖 Generated with Claude Code

The CLI gave every GET under /packages/ (search, details, versions,
installed, updates) 30 seconds. On Windows CI runners an npm search
or details call routinely takes 6-15 s and sometimes passes 30 s, so
cli-headless-e2e failed intermittently on `package search/details
--manager npm` and passed on re-run. Users on a slow network hit the
same limit.

When the limit fired, the cancellation surfaced as the bare "The
operation was canceled.", which reads like a cancelled package
operation. A client-side timeout now raises a TimeoutException naming
the request and the limit, and the status probe still treats it as an
unreachable endpoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The scoped changes preserve existing action deadlines and error-handling behavior, with no blocking issues identified.

No open issues 🎉

What changed in this PR

This PR gives CLI package queries more time to complete and makes client-side timeout errors easier to distinguish from cancelled package operations.

Changes:

  • Extends read-only package query deadlines from 30 seconds to two minutes, preserving five-minute action deadlines.
  • Reports expired deadlines with the request method, path, and timeout duration, and applies the deadline to response-body reads.
  • Treats the new TimeoutException as a connectivity failure for endpoint liveness checks.
File Description
src/​UniGetUI.Interface.IpcApi/​IpcClient.cs Adjusts query deadlines and improves timeout reporting and classification.

Review effort: Balanced

@randy-but-a-ro randy-but-a-ro Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉

Integration Details
{
	"deliveryId": "47f99090-cee0-11f1-824a-f2ff1b8f13b4",
	"headSha": "2e9beef860b1b3c3cc22cea0ff11fa4762d84f21",
	"reviewer": "copilot-pull-request-reviewer[bot]"
}

@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit ea19cf2 into main Oct 23, 2026
6 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the fix/ipc-package-query-timeout branch October 23, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants