mirror of
https://github.com/Stone-Red-Code/EchoHub.git
synced 2026-09-04 09:06:07 +02:00
- Implemented IrcCommandHandlerTests to cover various IRC commands including PING, JOIN, PART, and authentication scenarios. - Added IrcMessageFormatterTests to validate message formatting for different message types such as text, images, files, and audio. - Created IrcMessageTests to ensure correct parsing of IRC messages and handling of various command formats. - Introduced TestHelpers to facilitate testing with mock connections and streams, including a FakeChatService and FakeEncryptionService for simulating chat behavior.
1.1 KiB
1.1 KiB
v0.2.5 - IRC Gateway Fixes & Test Coverage
Fixes
IRC Gateway
- Fixed: IRC JOIN history replay showed encrypted gibberish —
IrcCommandHandler.HandleJoinAsyncnow decrypts channel history before formatting for IRC clients (history was encrypted for SignalR transport but sent raw to IRC) - Fixed:
JoinedChannelsrace condition —IrcClientConnection.JoinedChannelsreplaced with thread-safe methods (JoinChannel,LeaveChannel,IsInChannel,GetJoinedChannels) using lock synchronization; prevents crashes when broadcaster threads read while the command handler writes - Fixed:
RequireRegisteredfire-and-forget — converted from syncbooltoasync Task<bool>(RequireRegisteredAsync) so the error reply is properly awaited before the handler returns
Infrastructure
- IRC abstraction layer test suite: IrcMessage parsing, IrcMessageFormatter, IrcClientConnection, IrcCommandHandler, IrcBroadcaster (214 total tests)
- Test helpers:
TestDuplexStream,TestIrcConnectionFactory,FakeChatService,FakeEncryptionServicefor IRC unit testing without network I/O