Phase D: presence intent comment + sendZoneCombatMessages contract

D1: single block comment above the presence.go best-effort QueryRow
cluster (lines 149-198). Zero-value fallbacks are correct for new users
with no activity rows yet.

D2: contract comment on sendZoneCombatMessages — returns a done channel,
callers chaining post-flush work MUST consume it; in-flow handlers with
nothing to chain MUST explicitly discard. Blocking on flush would stall
command handlers behind the 2-3s/message pacing, defeating streaming.
Two fire-and-forget sites (adventure_arena.go round-advance,
dnd_zone_cmd.go streamFlow) now use `_ =` + comment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-05-15 08:03:42 -07:00
parent 2907a8ac1d
commit 9aca6b202d
4 changed files with 20 additions and 2 deletions

View File

@@ -652,7 +652,10 @@ func (p *AdventurePlugin) streamFlow(userID id.UserID, phaseMessages []string, f
if len(phaseMessages) == 0 {
return p.SendDM(userID, finalMessage)
}
p.sendZoneCombatMessages(userID, phaseMessages, finalMessage)
// Fire-and-forget: streamFlow's whole job is to hand off to the
// streamer and return — no post-flush chaining. Explicit discard
// honors the sendZoneCombatMessages contract.
_ = p.sendZoneCombatMessages(userID, phaseMessages, finalMessage)
return nil
}