- Removed dead code: unused struct fields, error variants, and
#[allow(dead_code)]annotations. - Renamed
chat_nametousernamethroughout the server crate for consistency. - Added shared binary parsing helpers (
extract_length_prefixed_string,validate_binary_length) to reduce duplicated parsing logic. - Replaced bare
.unwrap()on lock acquisitions with descriptive.expect()messages. - Replaced explicit
drop()calls with scoped blocks for clearer lock lifetimes. - Extracted file transfer logic into dedicated modules on both client and server.
- Replaced magic numbers with named constants across client, server, and shared crates (
DEFAULT_PORT,RECONNECT_DELAY,FILE_HEADER_OVERHEAD,TLS_HANDSHAKE_TIMEOUT,HEADER_SIZE,MessageTypesbyte constants). - Replaced unsafe
as u8andas usizecasts with safeTryFromconversions and added apush_length_prefixedhelper for length-prefixed string encoding. - Added
extract_field!macro (client) andparse_fieldhelper (server) to reduce repetitive binary parsing boilerplate. - Added
require_usernamehelper on the server to eliminate duplicated username-check match blocks. - Implemented
DisplayforChatClientError. - Split
handlers.rs(724 lines) intohandlers.rs,user_handlers.rs, andmessage_handlers.rs(246 + 294 + 188 lines). - Consolidated duplicate
completer.rsandreadline_helper.rsfrom client and server into shared crate (shared::completer,shared::readline).
- Ghost session reclaim: Reconnecting clients can now reclaim their own "ghost" session instead of being renamed. If you disconnect and reconnect quickly (before the 60s timeout), and your old session is still active, the server will recognize you and let you take over your username seamlessly.
- Fixed terminal cursor disappearing after
/quitcommand.
- Increased file transfer size limit from 10MB to 100MB.
- File transfers now require recipient acceptance. Sender uses
/send <user> <file>, recipient must/accept <sender>or/reject <sender>.
- Added client/server version checking. Clients with mismatched versions are disconnected with a link to upgrade instructions.
- Status now persists across reconnections but is cleared on explicit
/quit, kick, or ban.
- Refactored command parsing to use shared command constants, eliminating duplication between command definitions and input parsing.
- Better client reconnection.
- More robust dead connection logic.
- Fixed issues with input cursor and ctrl + c
- Centralize completer logic.
- Added User Status Command
- Server checks for disconnect cleanup
- Added file transfer