mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 08:52:42 +00:00
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:
@@ -146,6 +146,11 @@ func (p *PresencePlugin) handleWhois(ctx MessageContext) error {
|
||||
displayName = string(targetUser)
|
||||
}
|
||||
|
||||
// best-effort: activity tracking is non-critical; missing rows are
|
||||
// expected for new users. The cluster of `_ = QueryRow(...).Scan(...)`
|
||||
// calls below all share this rationale — zero values are the correct
|
||||
// fallback (no messages yet, no streak, no rep, no presence row).
|
||||
|
||||
// Get stats
|
||||
var totalMessages, totalWords int
|
||||
_ = db.Get().QueryRow(
|
||||
|
||||
Reference in New Issue
Block a user