Skip to content

fix(doctor): honor http timeout for version checks#9977

Merged
jdx merged 5 commits into
jdx:mainfrom
risu729:codex-20260519-052305-e45e65
May 20, 2026
Merged

fix(doctor): honor http timeout for version checks#9977
jdx merged 5 commits into
jdx:mainfrom
risu729:codex-20260519-052305-e45e65

Conversation

@risu729

@risu729 risu729 commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • use the configured http_timeout for the mise doctor/version endpoint check instead of a hardcoded 3s timeout
  • remove the dedicated version-check client so timeout hints point users at http_timeout / MISE_HTTP_TIMEOUT

History / Rationale

  • edb8a32ea (feat(timeout): show duration, URL, and config hint on timeouts; increase fetch timeout default to 10s) introduced ClientKind::VersionCheck => ("version_check_timeout", "") alongside the hardcoded 3s HTTP_VERSION_CHECK client.
  • That empty env var case was intentional: there was no real version_check_timeout setting/env var, so the timeout formatter avoided printing a misleading "change with ..." hint for version checks.
  • This PR removes that special version-check client path. The version check now uses the regular HTTP client, so the former empty-env-var branch is no longer reachable and timeout messages correctly point to the real http_timeout / MISE_HTTP_TIMEOUT controls.

Discussion

Tests

  • git diff --check
  • MISE_TRUSTED_CONFIG_PATHS=$PWD mise run build
  • Removed the e2e test because this PR is small and there is no separate way to configure only the version-check timeout; forcing a slow timeout path in test coverage could be troublesome for low-speed internet users.

@greptile-apps

greptile-apps Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR wires mise doctor's version-endpoint check through the standard HTTP client so it respects the user-configured http_timeout / MISE_HTTP_TIMEOUT instead of a hardcoded 3 s ceiling, and cleans up the dead code that was introduced alongside the old behaviour.

  • Removes HTTP_VERSION_CHECK (hardcoded 3 s) and ClientKind::VersionCheck; the version check in src/cli/version.rs now calls HTTP directly.
  • Simplifies the timeout-hint formatter in src/http.rs by eliminating the empty-env-var branch that only existed to suppress the "change with …" hint for VersionCheck — now every timeout message correctly points users at http_timeout / MISE_HTTP_TIMEOUT.

Confidence Score: 5/5

Safe to merge — the change is a clean removal of a now-redundant client and a corresponding simplification of dead conditional logic.

Both changed files are straightforward: the version check gains the user-configurable timeout it was missing, HTTP_VERSION_CHECK is fully removed with no remaining references, and the timeout-hint formatter loses only the branch that was guarding against an env-var that never existed as a real setting. The #[cfg(test)] stub for get_latest_version_call keeps tests unaffected by the HTTP client change.

No files require special attention.

Important Files Changed

Filename Overview
src/http.rs Removes HTTP_VERSION_CHECK static and ClientKind::VersionCheck variant; simplifies timeout-hint formatting by eliminating the empty-env-var branch that only existed for the removed variant.
src/cli/version.rs Single-line change: get_latest_version_call now uses HTTP (user-configured timeout) instead of the removed HTTP_VERSION_CHECK (hardcoded 3 s).

Reviews (5): Last reviewed commit: "Merge branch 'main' into codex-20260519-..." | Re-trigger Greptile

Comment thread src/http.rs Outdated

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the version check HTTP client to honor the user-configured http_timeout setting instead of a hardcoded 3-second duration. It also removes the specialized VersionCheck client kind in favor of the standard Http kind and includes a new end-to-end test to verify that mise doctor correctly respects the MISE_HTTP_TIMEOUT environment variable. I have no feedback to provide as no review comments were submitted.

@Patterner

Copy link
Copy Markdown

this is by far one of the best reaction a bug report i've seen

@risu729

This comment was marked as outdated.

@risu729 risu729 marked this pull request as ready for review May 20, 2026 05:10
@jdx jdx merged commit 3e6280c into jdx:main May 20, 2026
32 checks passed
@risu729 risu729 deleted the codex-20260519-052305-e45e65 branch May 20, 2026 15:47
mise-en-dev added a commit that referenced this pull request May 21, 2026
### 🚀 Features

- **(npm)** disable npm lifecycle scripts by default by @risu729 in
[#9913](#9913)

### 🐛 Bug Fixes

- **(completion)** avoid network calls when generating completions by
@sargunv-headway in [#10010](#10010)
- **(config)** track install manifest option source by @risu729 in
[#9958](#9958)
- **(doctor)** honor http timeout for version checks by @risu729 in
[#9977](#9977)
- **(github)** prefer primary binary assets by @risu729 in
[#10008](#10008)
- **(release)** bake secondary mise-plugins vfox plugins by @risu729 in
[#9832](#9832)
- **(shim)** preserve optioned aliases during rebuilds by @risu729 in
[#9848](#9848)

### 🚜 Refactor

- **(dotnet)** parse backend tool options locally by @risu729 in
[#9962](#9962)

### 📚 Documentation

- remove how i use mise article by @jdx in
[#9996](#9996)

### 🧪 Testing

- **(s3)** cover current config over install manifest opts by @risu729
in [#9917](#9917)

### 📦️ Dependency Updates

- update astral-tokio-tar by @jdx in
[#9997](#9997)

### 📦 Registry

- update entry for vale by @eread in
[#10002](#10002)
- use aqua backend for vector by @jdx in
[#10011](#10011)

## 📦 Aqua Registry Updates

### New Packages (2)

- `google.com/antigravity-cli`
-
[`sholdee/crd-schema-publisher`](https://github.com/sholdee/crd-schema-publisher)

### Updated Packages (4)

- [`FairwindsOps/pluto`](https://github.com/FairwindsOps/pluto)
-
[`goccy/bigquery-emulator`](https://github.com/goccy/bigquery-emulator)
- [`sourcemeta/jsonschema`](https://github.com/sourcemeta/jsonschema)
- [`wasmCloud/wasmCloud/wash`](https://github.com/wasmCloud/wasmCloud)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants