From ce151f39aa1e435a2b51da5e6a572a0a269034fd Mon Sep 17 00:00:00 2001 From: Artem Tsyrulnikov Date: Sun, 8 Feb 2026 19:43:51 +0300 Subject: [PATCH] debug log --- cmd/handlers.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/handlers.go b/cmd/handlers.go index 127aa95..a56ab0f 100644 --- a/cmd/handlers.go +++ b/cmd/handlers.go @@ -96,15 +96,20 @@ func getConfiguredGroups() []int64 { // HandlePollAnswer processes poll responses func HandlePollAnswer(ctx context.Context, db *sql.DB, api echotron.API, pollAnswer *echotron.PollAnswer) { if pollAnswer.User == nil { + log.Warn().Msg("PollAnswer with nil User received") return } + // Log every poll answer for debugging + log.Info().Str("poll_id", pollAnswer.PollID).Int64("user_id", pollAnswer.User.ID).Str("username", pollAnswer.User.Username). + Interface("option_ids", pollAnswer.OptionIDs).Msg("Poll answer received") + // Try to find the poll in our database groupID, err := database.GetGroupIDByPollID(ctx, db, pollAnswer.PollID) if err != nil { // Poll not found - this is OK, it might be an old poll that was already processed // Don't spam logs with errors for old polls - log.Debug().Str("poll_id", pollAnswer.PollID).Msg("Poll not found (probably old poll)") + log.Warn().Err(err).Str("poll_id", pollAnswer.PollID).Msg("Poll not found in database") return }