feat: add dynamic channel management (/join, /part) - #8
Merged
Merged
Conversation
Accepted sockets inherit the listener's non-blocking mode on Windows, so read_line returned WouldBlock instead of waiting for the read timeout; all dynamic_channels integration tests panicked.
fix: restore blocking mode on accepted mock sockets on Windows
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
Channels are no longer config-only. This PR adds runtime channel management —
/joinand/part— with per-channel server confirmation, while thechannelsconfig key becomes the startup join intent.Commands
/join #channel/part [#channel] [reason]Both are online-only: the server must have completed registration. Channel names follow the configuration rule — a single
#or&prefix with at least one character; whitespace, control characters, commas and colons are rejected. No channel keys or multi-target entries.Behavior
/joins, excluding parted channels).JOIN/PARTlines go through the same managed state — they cannot bypass runtime intent and produce no console echoes.PARTnever deletes history: the buffer, draft and reading position survive.Implementation
src/connection/channels.rs(new) — per-channel confirmation state machine in the worker; deadlines and errors scoped to the operation.src/application/channels.rs+channel_tests.rs(new) — session join/part intent, buffer lifecycle and status queries.src/command.rs—/join//partparsing (reason preserved, invalid names rejected with the draft retained).src/protocol.rs— structured channel errors (code, target, reason).src/tui/render.rs— extended status-dot semantics.src/config.rs— validate configured channel names at load time.channel-listsfeature from theircdependency; channel state is now managed locally. No new dependencies.Tests
tests/dynamic_channels.rs: 16 integration tests over a mock IRC server on127.0.0.1— join waits for own confirmation, independent JOIN/PART deadlines, late confirmations, kick vs. unsolicited PART, reconnect intent, raw-command bypass prevention, offline rejection, and buffer/draft survival.cargo fmt --checkandcargo clippy --all-targets -- -D warningsclean.read_linereturnWouldBlockinstead of honoring the read timeout.Docs
channels, and the extended status-dot legend.config.example.toml: documentschannelsas startup join intent.