From 8c3ca598727c7ebe759f3354e7da789294fbf697 Mon Sep 17 00:00:00 2001 From: Patrick Britton Date: Sun, 1 Feb 2026 12:48:40 -0600 Subject: [PATCH] Add debug logging to ToggleReaction to identify the error --- go-backend/internal/repository/post_repository.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go-backend/internal/repository/post_repository.go b/go-backend/internal/repository/post_repository.go index c158951..6b760c8 100644 --- a/go-backend/internal/repository/post_repository.go +++ b/go-backend/internal/repository/post_repository.go @@ -1095,7 +1095,10 @@ func (r *PostRepository) ToggleReaction(ctx context.Context, postID string, user goto calculate_counts } } else if err != sql.ErrNoRows { + log.Error().Err(err).Str("postID", postID).Str("userID", userID).Msg("DEBUG: Failed to check existing reaction - unexpected error") return nil, nil, fmt.Errorf("failed to check existing reaction: %w", err) + } else { + log.Info().Str("postID", postID).Str("userID", userID).Msg("DEBUG: No existing reaction found (expected)") } // Add the new reaction