Skip to content

Check the latest GitHub release for plugin updates - #238

Merged
minoneer merged 4 commits into
masterfrom
feature/update-check-github
Oct 25, 2026
Merged

minoneer merged 4 commits into
masterfrom
feature/update-check-github

Conversation

@minoneer

@minoneer minoneer commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

The release update check now asks GitHub instead of uskyblock.ovh, the first step away from our own server.

  • RELEASE channel: SkyUpdateChecker reads tag_name from https://api.github.com/repos/uskyblock/uSkyBlock/releases/latest. That endpoint skips drafts and prereleases, so a release made a draft or prerelease on GitHub stops being offered. The leading v is stripped; versions compare as before.
  • Failures: a non-2xx response (403/429 rate limits included), bad JSON, an unexpected body or no connection at all (no network, DNS, timeout, TLS) gives no version and no stack trace. The console says once per run of failures: Failed to check for new uSkyBlock versions. Please check for updates manually at https://uskyblock.github.io/. It repeats only after a check has succeeded in between. /usb version shows the same hint. Only a truly unexpected exception still logs a stack trace, once. The check runs async every 4 hours, so a server sends 6 requests a day; GitHub's unauthenticated limit is 60 an hour per IP.
  • /usb version: it had an update checker of its own that never ran a check, so its update notice never showed. SkyUpdateChecker is a singleton now.
  • STAGING: still reads staging.json.
  • API: URL_RELEASE stays in both API modules for compatibility and is @Deprecated(since = "3.8.0"). The GitHub URI is private to Core.
  • Old installs: the release workflow keeps writing release.json, so they still see new versions.

Tests: 19 in SkyUpdateCheckerTest and 3 in a new PluginInfoTest, all without network: tag parsing, failure handling and the hint's once-per-streak logging, version comparison, and which source each branch asks. Checked once by hand against the live API, which returned 3.7.1.

The RELEASE channel now asks the GitHub API for the latest published
release (drafts and prereleases are skipped) instead of release.json on
uskyblock.ovh, and reads its tag without the leading "v". STAGING still
reads staging.json.

Non-2xx responses, including GitHub's rate limit, and unparseable bodies
give no version, so they log the usual single INFO line instead of a
stack trace.

URL_RELEASE stays in both API modules for compatibility and is marked
deprecated.
When an update check gets no version (non-2xx, rate limit, bad body,
network error), the console now says so and points to
https://uskyblock.github.io/ for a manual check. The line is logged on
the first failure only and again after a check has succeeded in
between, so a lasting outage doesn't repeat it every 4 hours. RELEASE
and STAGING share this path.

/usb version shows the same hint after a failed check, next to the
existing update notice. SkyUpdateChecker is now a singleton: the
command used to get its own instance that never ran a check, so it
could show neither the update notice nor the hint.
When the update check can't reach GitHub or the staging feed at all (no
network, DNS failure, connect or read timeout, TLS error), it logged a
SEVERE "Exception while trying to fetch latest plugin version." with a
stack trace on every 4-hourly check. Such I/O failures are now silent;
the manual-check hint covers them, once per failure streak.

Unexpected exceptions still log SEVERE with a stack trace, but only on
the first failed check in a row, and still only while the plugin is
enabled. The HTTP request moved into its own method so tests can make
it fail.
@minoneer
minoneer merged commit a060c74 into master Oct 25, 2026
6 checks passed
@minoneer
minoneer deleted the feature/update-check-github branch October 25, 2026 17:18
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.

1 participant