Skip to content

test(spigot): guard the post-spawn chat path that closed a 26.3 tunneled session - #172

Merged
minekube-ai-engineer[bot] merged 1 commit into
mainfrom
test/post-spawn-chat-tunnel-guard
Sep 27, 2026
Merged

minekube-ai-engineer[bot] merged 1 commit into
mainfrom
test/post-spawn-chat-tunnel-guard

Conversation

@minekube-ai-engineer

Copy link
Copy Markdown

Source: Discord ask-support thread

Why

SpigotChatSessionPacketFilter sits in the injected local channel's pipeline
(SpigotDataAddon.onInject puts it directly in front of the vanilla network manager) and it handles
post-spawn traffic. A 26.3 packet shape it cannot handle therefore never fails a login: it throws
with the player already in play, the network manager answers an escaping throwable with
lost connection: Internal Exception: <cause>, and that closes the injected channel - so with it the
Connect tunnel, roughly a second after spawn.

0.15.14 resolved ServerboundChatPacket's constructor by hard-coded parameter types while Minecraft
had moved the signature component to Optional<MessageSignature>, so every plain post-spawn chat
packet from a 1.21.5+/26.x client threw there. #170 fixed the resolution (shipped in 0.15.15) and its
test covers the rewrite by calling the private method directly; nothing asserted the pipeline
consequence, which is the part that ends a session.

What this adds

SpigotChatSessionPacketFilterPipelineTest - test-only, no production change: the real filter in a
real Netty pipeline, at its production position
(connect_data_handler -> connect_chat_session_filter -> network manager), with the network-manager
node modelled the way Paper behaves (record the throwable that escapes a handler, then close the
connection). Asserted:

  • the post-spawn packet sequence (chat-session update, chat ack, chat) leaves the session open,
    drops the session-only packets, and delivers the chat to the network manager rewritten exactly once
    • for the 26.3 signed and unsigned component shapes and for the pre-1.21 raw shape (26.2 behaviour
      unchanged), plus the signature-absent variant;
  • the resolver refuses an unknown component shape instead of guessing one.

Two one-class stubs (ServerboundChatAckPacket, ServerboundChatSessionUpdatePacket) join the
existing net.minecraft... test stubs so the filter's class-name drop path is exercised too.

RED before / GREEN after

Reverting only the filter file to its 0.15.14 content (tests unchanged) reds 5 of 8:

SpigotChatSessionPacketFilterPipelineTest > postSpawnSignedChatFromA26_3ClientKeepsTheTunneledSessionOpen() FAILED
    a post-spawn packet threw out of the chat filter: [java.lang.IllegalArgumentException: argument type mismatch]
SpigotChatSessionPacketFilterPipelineTest > postSpawnUnsignedChatFromA26_3ClientKeepsTheTunneledSessionOpen() FAILED
SpigotChatSessionPacketFilterPipelineTest > thePostSpawnPacketSequenceKeepsTheSessionOpenAndDropsSessionOnlyPackets() FAILED
SpigotChatSessionPacketFilterPipelineTest > anUnresolvableChatShapeIsRefusedInsteadOfGuessed() FAILED
    java.lang.NoSuchMethodException: ...SpigotChatSessionPacketFilter.chatConstructor(java.lang.Class,java.lang.Object,java.lang.Object)
SpigotChatSessionPacketFilterTest > rewritesChatPacketWhenSignatureComponentIsOptional() FAILED
8 tests completed, 5 failed

On the unfixed revision the throwable is recorded by the network-manager node, not by
CommonDataHandler.channelRead's catch (the captured test stderr contains no printStackTrace) -
which is why the player-visible line is Paper's Internal Exception rather than a quiet close. Live
against Paper 26.3 the same hard-coded lookup is a NoSuchMethodException (the raw 5-arg constructor
no longer exists); the dual-shape test stub surfaces it one step later as
IllegalArgumentException: argument type mismatch from the same lookup.

GREEN: ./gradlew build (what CI runs) is BUILD SUCCESSFUL - 444 test cases (core 375, spigot 33,
velocity 32, bungee 4), 0 failures/errors; the new class passes 6/6.

Scope

This is the missing guard for #170's fix, not a new fix, and it is not a claim about the ~15 %
probabilistic 26.3 post-join teardown that the customer reported - that one is still unlocated.

@minekube-ai-engineer
minekube-ai-engineer Bot merged commit 218cbcb into main Sep 27, 2026
2 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.

0 participants