Polls showing duplicate voters

AI-generated summary

A bug has been reported in the polls feature, showing duplicate voters. seanblue noticed the issue and shared screenshots as examples. The problem seemed to occur when the “show more voters” arrow was clicked, causing duplicates to appear. seanblue investigated further and found that the first 25 avatars (visible without clicking the arrow) had no duplicates, but duplicates appeared after clicking the arrow.

After reporting the issue, codinghorror mentioned that zogstrip had a plan to fix it. zogstrip suggested ensuring the array only has unique values to prevent duplicates. nbianca fixed the issue in a pull request, but seanblue requested the change be pushed to the live site as the issue was still present. zogstrip confirmed the fix and reported no more duplicates.

Polls are now showing duplicate voters. For example:

The one in the top-left corner is me. Interestingly enough, I switched my vote to another option and then switched back, and now I don’t show up at all. Even though my image doesn’t show up, there are still the same number of avatars displayed, though the order has also changed. Also, the total number of avatars shown does not match the total number of votes indicated by the number on the right-hand side of the poll.


Here’s a second poll with this issue in case it helps:

4 Likes

Just to update, it might have something to do with when you click the arrow to show more voters. Both of the polls mentioned above have enough voters that I needed to click the arrow to see everyone. Note that the first 25 avatars (those visible without clicking the arrow) have no duplicates within the first 25, and duplicates only appear after clicking the arrow.

Also, I just created an active poll that had two visible voters. The arrow appeared, indicating that a third person had just voted. When I clicked the arrow, five avatars total were displayed, including all three voters plus duplicates of the first two voters. Refreshing caused it to correctly display just the three voters, and since there was no longer an arrow there was no way to cause it to happen again.

3 Likes

Any progress on this one?

I believe @zogstrip has a plan for this one, not sure what it is.

1 Like

@nbianca, can you make sure we never show the same avatar/user twice by making sure the array only has unique values?

4 Likes

Fixed in

https://github.com/discourse/discourse/pull/6746

7 Likes

Can you push this change out to https://community.wanikani.com? I’m still seeing the issue there.

Not seeing any duplicates anymore :face_with_monocle:

4 Likes