fix(server): issues #115-#118 kick, empty text, SQLite busy - #119
Conversation
Self-targeting :kick/:ban disconnected the admin and wrote a 24h ban with no reply. KickUser/BanUser now return errors so chat, TUI, and web claim success only on nil.
Kick requires an active connection; offline targets return ErrKickNotConnected without tempKicks or ban_history. BanUser remains offline-capable.
Unencrypted empty or whitespace-only content is dropped with a System reply and never persisted; encrypted opaque payloads stay unchecked.
Per-connection modernc DSN pragmas and MaxOpenConns(1) replace one-shot PRAGMA Exec so pooled writers no longer fail with SQLITE_BUSY under load.
|
I re-checked #118 against the current implementation and primary docs. Verdict: the current #118 fix is sufficient. The fix applies SQLite pragmas through the modernc.org/sqlite DSN before opening the DB, including The in-repo proof is The test proves the database-layer same-process concurrent insert path. It does not claim to be a full WebSocket fan-in reproduction or an external-process lock test. |
Summary
Fixes #115
Fixes #116
Fixes #117
Fixes #118
Test plan
Black-box against binaries built from this branch (temp server on localhost, raw WebSocket client, SQLite file DB):
You cannot kick yourself.; connection stays open; reconnect works (no 24h ban)You cannot ban yourself.; reconnect works (not permanently banned)user is not connected(not success); target can still connect (no ban)You are banned from this serverMessage not sent: empty content; Encrypted opaque content still acceptedSQLITE_BUSY/ insert-lock errors in server log