mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
SendDM/SendMessage went straight through Base to the live client with no fake, so every handler whose only observable output is a DM stopped below the test boundary — which is how the party close-out bug (fix #1) and the member soft-lock (fix #2) survived a thorough suite: nothing could see what was, or wasn't, sent. Add a MessageSink interface and a Base.Sink field. When non-nil it captures every outbound message — both the DM route (SendDM/SendDMID) and the room route (SendMessage/SendMessageID, which is what the arena announcement uses) — and the client is never touched. Nil in production, so behaviour is unchanged; one seam, no call-site churn, since all 765 send sites are downstream of these four methods. Tests (message_sink_test.go): a captureSink double + installSink helper; TestMessageSink_CapturesDMAndRoom proving both routes divert with the right target/text and that the *ID variants report an id back; and TestExpeditionCmdLeave_DMsBothEnds, which drives the real fix-#2 handler end to end and asserts both DMs land — a path that was a silent no-op in a unit test before. beginCombatTurn's terminal path and the arena rollover are now reachable the same way. Claude-Session: https://claude.ai/code/session_017mEwUmmS7aQTP2NQXj6rUa