feat: replace [pin] on initial kick and fix pinCheck boot warning#33
Merged
feat: replace [pin] on initial kick and fix pinCheck boot warning#33
Conversation
Listen to PlayerBannedEvent on all 6 platforms to call handlePin when a kickMessage is present, enabling [pin] replacement on the first kick of an online player (not just reconnect denial). Change ExpiresSync from extends BmRunnable to implements Runnable to eliminate the spurious "unknown last checked pinCheck" log on every boot. Add e2e tests verifying the kick message contains a 6-digit pin when banning/tempbanning an online player. Add waitForKick() helper to TestBot with proper listener cleanup and race-safe settlement.
The e2e message configs only had [pin] in the disallowed (reconnect denial) templates but not in the kick (online player) templates, causing the Online Kick Pin tests to fail.
- Handle NBT compound chat components in kick reasons (Paper 1.20.5+) - Add delay in waitForKick end handler to avoid socketClosed race - Increase denial retry attempts and sleeps for async ban persistence - Disconnect bot before unban in afterEach to avoid stale kick on reconnect
- Add --refresh-dependencies to build step to force fresh SNAPSHOT resolution - Use run_id in Loom cache key to prevent serving stale remapped dependency JARs
- Checkout BanManager and publishToMavenLocal in both CI workflows so WebEnhancer always compiles against the latest API (Fabric Stonecutter artifacts are not reliably published to Maven Central snapshots) - Clean up mineflayer bot (removeAllListeners + end) on kick/error during connect() and waitForKick() to prevent physics timers running after Jest teardown
- Clear BanManager artifacts from Gradle and Loom caches before build so publishToMavenLocal takes priority over stale cached SNAPSHOTs - Add --refresh-dependencies to Gradle build commands to bypass dependency resolution cache entirely - Wait for mineflayer 'end' event before resolving waitForKick() and connect() cleanup, so the physics timer is cleared before Jest teardown begins (prevents prismarine-physics ReferenceError) - Stop calling removeAllListeners() before bot.end() which stripped mineflayer's internal cleanup handlers
… OOM Dependencies are already freshly resolved by the preceding build step. The redundant --refresh-dependencies on the memory-intensive Loom remapping step caused OutOfMemoryError.
- Clear both permanent and temp bans in afterEach (bmunban + bmuntempban) - Disconnect bot before unban to avoid stale state - Add 2s sleep after cleanup for async processing to settle - Increase sleep after bmtempban from 3s to 5s for Fabric enforcement lag
On Fabric 1.21.4, tempbanned players sometimes enter a limbo state (connected but neither spawned nor kicked) consuming the full 30s connect timeout per attempt. Use a 10s timeout with 8 retries instead, and increase the test timeout to 120s for headroom.
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.
Listen to PlayerBannedEvent on all 6 platforms to call handlePin when a kickMessage is present, enabling [pin] replacement on the first kick of an online player (not just reconnect denial).
Change ExpiresSync from extends BmRunnable to implements Runnable to eliminate the spurious "unknown last checked pinCheck" log on every boot.
Add e2e tests verifying the kick message contains a 6-digit pin when banning/tempbanning an online player. Add waitForKick() helper to TestBot with proper listener cleanup and race-safe settlement.