Let the window close, answer stray handshake frames, reply where asked - #41
Merged
Conversation
- Closing the chat window while the connection dialog is open left the thread inside requestConnectionSettings blocked on its latch forever, so the JVM never exited. windowClosing now completes the pending request the same way Cancel does. - NAME_REQUEST and USER_NAME were the only frame types left to the default branch of the server loop, so a stray handshake frame dropped the connection with an IOException while every other misplaced frame got a soft "Unsupported client frame" error. - The bot answered every command with a plain text message to the general room: a private question got a public answer, and a question asked in a room was answered elsewhere. It now replies in the room it was asked in, or privately to the sender of a private command. - ci.yml pinned gradle-version 8.10.2 for setup-gradle although the build runs through the 9.7 wrapper, so that download was dead weight (codeql.yml already omits it). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.



Summary
requestConnectionSettingsblocks on aCountDownLatchuntil Connect or Cancel completes the request. Closing the window only calledcontroller.disconnect(), so the waiting thread stayed parked and the JVM never terminated.windowClosingnow completes the pending request exactly like Cancel, which makesClientGuiController.rundispose and return.Unsupported client frameerror, exceptNAME_REQUESTandUSER_NAME, which fell through todefault -> throw new IOException(...). Both are now handled with the same soft error, and the switch covers the enum.BotChatClientalways replied withsendTextMessage, i.e. plain text in the general room: a private command got a public answer, and a command asked inside a room was answered somewhere else. Replies now go back to the room the command came from, or privately to the sender of a private command.ci.ymlaskedsetup-gradlefor Gradle 8.10.2 while the build runs./gradlew(wrapper 9.7), so that distribution was downloaded and never used;codeql.ymlalready omits the pin.Not changed (needs a decision)
maxRoomsslots permanently. Whether restored rooms should be pre-created at all, or reclaimed lazily, is a product decision.ChatHistoryStorerewrites and fsyncs the whole file per message under a global lock — a durability/throughput trade-off, not an accident.Test plan
./gradlew spotlessApply check— BUILD SUCCESSFUL (spotless, checkstyle, spotbugs, unit/integration/ui tests,-Werror).BotChatClientTest.answersPrivateCommandsPrivately,answersRoomCommandsInTheSameRoom.🤖 Generated with Claude Code