From 07bd84802848bf9a83683db0a1e6ada60d2f04d1 Mon Sep 17 00:00:00 2001 From: Sam Lade Date: Sat, 16 Dec 2023 19:12:25 +0000 Subject: [PATCH] fix poll total vote double count (#2464) --- internal/typeutils/internaltofrontend.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go index 353c719b5..09d538a3d 100644 --- a/internal/typeutils/internaltofrontend.go +++ b/internal/typeutils/internaltofrontend.go @@ -1484,6 +1484,9 @@ func (c *Converter) PollToAPIPoll(ctx context.Context, requester *gtsmodel.Accou // disabled, or the requester is the author // do we actually populate the vote counts. + // If we voted in this poll, we'll have set totalVotes + // earlier. Reset here to avoid double counting. + totalVotes = 0 if *poll.Multiple { // The total number of voters are only // provided in the case of a multiple