Repository navigation
fix(spigot): keep handling LOGIN_START after stripping a handshake marker - #183
Merged
minekube-ai-engineer[bot] merged 1 commit intoNov 24, 2026
Merged
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Source: Discord ask-support thread · "Issue with online-mode: true" — reporter Sul3 / in-game
R6vibin.Symptom
Paper 26.3,
online-mode=true,enforce-secure-profile=false, connect-spigot 0.15.18, endpointofflineModeHeader: "false". A Forge/NeoForge launcher profile always lands in the browser hub; a plain vanilla 26.3 profile joins fine, andonline-mode=falsejoins fine.Edge (
connect-proxy, connectorVersion 0.15.18, connectorMinecraftVersion 26.3): the tunnel opens and dies 20–34 ms later —Paper logs only the two lines
[connect] Connect tunneled player <name> disconnectedand<name> (/172.16.x.x:0) lost connection: Disconnected— nologged in as, no disconnect reason.Root cause
The Forge client's handshake carries a
\0FORGEmarker in the hostname. With BungeeCord forwarding disabled the connector strips that data (the "BungeeCord mode disabled but hostname contained forwarding data" branch), rebuilds the handshake for 1.20.2+, fires it — and then removed itself from the pipeline (removeSelf()), copied over from the BungeeCord-forwarding branch where it is correct.On the forwarding-disabled path Connect owns the login: the fake offline login cycle (
spoofedUUID→callPlayerPreLoginEvents→startClientVerification) runs whenLOGIN_STARTarrives, i.e. the packet after the handshake. With the handler already gone,LOGIN_STARTwent straight to the server, no profile was injected, and Paper (online-mode=true) started its own encryption handshake into the tunnel. The edge cannot answer an encryption request, so the backend connection was closed within ~20 ms — before any client round trip — and the player was sent to the hub.That is also why
online-mode=falseworks on the same stack: the server asks for no encryption, so the missing injection never matters. The strip itself is fine; only the discarded pipeline slot is the defect.Fix
Keep the connector installed after stripping forwarding data from a hostname. Only the BungeeCord-forwarding path — where the server owns the login — leaves the pipeline, and it still honours ProtocolSupport (which needs the connector to stay, or the player is kicked with "unexpected hello packet").
The handshake decision is now a tested seam (
HandshakeView/handleHandshake) so both the hostname the server receives and the connector's pipeline decision are covered;ClassNamesneeds a live server and cannot be exercised from a unit test.Evidence
Disposable pod: Paper 26.3-49 + connect-spigot + the endpoint's connector config, real tunnel through the production edge, synthetic 26.3 client (protocol 777) with only the handshake hostname changed.
host\0FORGEbackend_disconnect/backend_connect21.67059 ms, browser fallback; Paper:Connect tunneled player HProbeRed4 disconnected+lost connection: Disconnectedhostresult: success,backendDuration 510.938064 ms, joined and stayed in PLAYonline-mode=falsehost\0FORGEConnect tunneled player logged in as HProbeOff— stayed 20 s. The marker alone is harmless; the skipped injection is the defecthost\0FORGEresult: success,backendDuration 1.775680597 s, no fallback; Paper:Connect tunneled player logged in as HProbeFix (UUID: …),joined the gamehostresult: success,Connect tunneled player logged in as HProbeCtl2, stayed in PLAYTests
SpigotHandshakeStripTest(new) drives the production decision: a marker is stripped and the connector stays installed, a clean handshake is passed through unchanged, BungeeCord forwarding still injects the player data and leaves the pipeline, ProtocolSupport still keeps it.stopAfterHandshake()on the strip path) fails exactlykeepsTheConnectorInstalledWhenItStripsAForwardingMarker(), so the regression guard is red on the defect../gradlew :core:test :api:test :spigot:check :spigot:shadowJargreen in a sandbox pod (433 tests).