Skip to content

fix(doctor): check for updates against the latest GitHub release - #14162

Merged
HarshMN2345 merged 2 commits into
mainfrom
fix/doctor-version-check
Oct 6, 2026
Merged

HarshMN2345 merged 2 commits into
mainfrom
fix/doctor-version-check

Conversation

@HarshMN2345

@HarshMN2345 HarshMN2345 commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Fixes #7717

The doctor checked for updates by fetching _APP_HOME . '/version' (https://appwrite.io/version). That URL returns a 404 HTML page, so every production run printed "Failed to check for a newer version". The comparison was also wrong: any version that wasn't equal counted as "a new version is available", including an RC running ahead of the latest release.

The doctor now reads tag_name from GitHub's releases/latest, which excludes pre-releases. It uses Utopia\Client with the curl adapter, the same client Install.php uses, with a 5s connect and total timeout and a User-Agent header (GitHub returns 403 without one). The running version is still _APP_VERSION, which release images get from the git tag. A new version is reported only when version_compare(latest, running, '>'); an equal or newer running version counts as the latest. Network failures still print the existing failure line.

I ran the real doctor in a throwaway container with _APP_ENV=production:

Run Output
main Failed to check for a newer version
branch, _APP_VERSION=dev A new version (2.3.0) is available!
branch, _APP_VERSION=2.3.0 You are running the latest version of Appwrite!
branch, _APP_VERSION=2.2.0 A new version (2.3.0) is available!
branch, _APP_VERSION=2.4.0-rc.1 You are running the latest version of Appwrite!
branch, offline (--network none) Failed to check for a newer version

No PHP warnings, and Pint passes. These runs used the dev image with _APP_VERSION overridden, not a release image. Unauthenticated GitHub API calls are limited to 60 per hour per IP; a rate-limited response has no tag_name, so it falls into the existing failure line (I didn't hit this in testing). Nightly images from a line that already has a release, like 2.3-nightly.<date>, compare lower than 2.3.0 and will be told 2.3.0 is available.

The doctor now reads tag_name from GitHub's releases/latest instead of the _APP_HOME /version page, which returns 404. It reports a new version only when that release is newer than the running _APP_VERSION.
@ghost

ghost commented Oct 6, 2026

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

No concrete defects found after checking the HTTP client contract, exception handling, and release version conventions.

Doctor now checks GitHub’s latest stable release instead of the unavailable website version endpoint. The request uses the Utopia curl client with five-second timeouts and a User-Agent, and update notices appear only when the release version is newer than the running version. Existing failure output is preserved for unsuccessful checks.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 1
File Change
src/Appwrite/Platform/Tasks/Doctor.php Fetch GitHub release metadata with bounded HTTP timeouts and compare tag_name against the running version.

Reviewed d331c67 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost 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.

🟢 Tier S · Looks good to merge. Summary

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix/doctor-version-check (after).

Metric Before After Change
🚀 Requests/sec 174.88 174.38 ⚪ -0.3%
⏱️ Latency P50 97.84 ms 98.96 ms ⚪ +1.1%
⏱️ Latency P95 233.21 ms 233.03 ms ⚪ -0.1%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 98.96 233.03 11,286 174.38 -0.18
Account 193.16 376.59 594 9.89 +3.95
TablesDB 95.65 182.02 6,138 97.83 -0.87
Storage 91.18 201.1 2,970 48.52 -0.81
Functions 139.1 281.78 1,584 26.5 -7.11

Top API waits (after)

API request Max wait (ms)
account.name.update 533.01
functions.create 510.46
functions.variables.update 496.13
account.prefs.update 458
functions.delete 432.91

@HarshMN2345
HarshMN2345 merged commit 498b885 into main Oct 6, 2026
9 checks passed
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.

🐛 Bug Report: Doctor Always Fails to Check for Updates

2 participants