Skip to content

Bridge installer: make the bundled jar a real fallback (#103 follow-up) - #111

Merged
CaYatur merged 1 commit into
mainfrom
fix/bridge-fallback
Jul 28, 2026
Merged

Bridge installer: make the bundled jar a real fallback (#103 follow-up)#111
CaYatur merged 1 commit into
mainfrom
fix/bridge-fallback

Conversation

@CaYatur

@CaYatur CaYatur commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Self-review

1. The bundled jar was a fallback for one failure, and not the likely one

installBridge picked a source and committed to it: newest wins, and if that
was GitHub then a failed download refused the install. So the bundled jar
covered exactly one case — GitHub's API being unreachable, which is what makes
latestBridge() return null.

The commoner failure is not that. It is the API answering while the asset
download fails: a CDN hiccup, a connection dropped mid-stream, or a corporate
proxy that allows api.github.com but not objects.githubusercontent.com.
In all of those the old code refused, with a perfectly good jar sitting in
resources/.

That is the whole point of shipping the jar, missed by one else if.

installPlan() now returns an ordered list and the installer walks it. A
bad-asset refusal falls through the same way a download failure does, since
"the release is wrong" is exactly when the local copy is worth having. An older
bundled jar is still a working bridge, and the result reports which source it
came from, so nothing is claimed that is not true. Downloading a release older
than the bundled one stays excluded — that is work done to arrive somewhere
worse.

bridgeStatus now reads the first step of the same plan, so the version the
warning names is the version the button delivers; it had its own copy of the
ordering, which is two places to change and one to forget.

Proved failable: reducing the plan to ['github'] gives
FAIL - a failed download would not fall back to the bundled jar: github.

2. A disabled bridge was invisible, so an install left two of them

installedJars matched MSMS-Bridge-1.0.0.jar and therefore never saw
MSMS-Bridge-1.0.0.jar.disabled. Two consequences: the status reported
missing and offered to install 1.0.0 to someone who already had 1.0.0 sitting
there disabled, and the post-install cleanup — which exists so the folder never
holds two bridges — skipped it. A server whose operator had turned the plugin
off once would accumulate a disabled jar per version forever.

Disabled jars are now found and cleaned up, while installedBridgeVersion still
only counts enabled ones: Bukkit does not load a .disabled, so reporting it as
installed would be a lie in the other direction.

Not fixed

installBridge cannot be exercised end-to-end by the smoke — it needs either a
network or a writable fixture with a recognised server type, and the gate has
neither. The ordering is asserted as a pure decision and the route is asserted
to ignore a caller-supplied url/version/name; the download itself is not.

Verified

Twelve gates green.

installBridge picked one source and committed to it, so the jar shipped with the
app only covered GitHub being unreachable. The commoner failure is the API
answering while the asset download does not — a dropped connection, or a proxy
that allows api.github.com but not objects.githubusercontent.com — and there the
install refused with a perfectly good jar on disk. That is what shipping the jar
is for.

installPlan() returns an ordered list and the installer walks it; a bad-asset
refusal falls through the same way, since "the release is wrong" is exactly when
the local copy is worth having. bridgeStatus reads the first step of the same
plan rather than repeating the ordering, so the version the warning names is the
version the button delivers.

installedJars matched only enabled jars, so a disabled bridge jar was invisible:
the status offered to install a version already sitting there, and the
post-install cleanup skipped it, so a server accumulated a disabled bridge per
version its operator ever turned off. Disabled jars are now found and cleaned
up; installedBridgeVersion still counts only enabled ones, because Bukkit does
not load one.
Copilot AI review requested due to automatic review settings July 28, 2026 18:14

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CaYatur
CaYatur merged commit cb363f5 into main Jul 28, 2026
1 check passed
@CaYatur
CaYatur deleted the fix/bridge-fallback branch July 28, 2026 18:15
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.

2 participants