Skip to content

feat: replace [pin] on initial kick and fix pinCheck boot warning#33

Merged
confuser merged 10 commits intomasterfrom
fix/pin-placeholder-on-kick
Apr 4, 2026
Merged

feat: replace [pin] on initial kick and fix pinCheck boot warning#33
confuser merged 10 commits intomasterfrom
fix/pin-placeholder-on-kick

Conversation

@confuser
Copy link
Copy Markdown
Member

@confuser confuser commented Apr 3, 2026

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.

confuser added 10 commits April 3, 2026 16:15
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.
@confuser confuser merged commit 3239eed into master Apr 4, 2026
12 of 13 checks passed
@confuser confuser deleted the fix/pin-placeholder-on-kick branch April 4, 2026 11:47
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