Avatar still shown in "voted" pane after vote removed

סיכום מבוסס בינה מלאכותית

A user reports that their avatar remains visible in the “voted” pane after removing a vote, even though the vote count is correct. The issue appears to be a JavaScript display bug, as the user’s name is not included in the database query results. barryvan suspects the problem lies in the scheduleRerender() not being called after the removeVote() request completes. They have submitted a PR to fix this by ensuring scheduleRerender() is always called at the end of the addVote() promise resolution barryvan.

I had a vote on a topic, but later removed it; the number of votes is reflected correctly. However, the details of who voted still includes me:

…and thus shows thirteen people.

I’m not sure if this affects just the currently-logged in user, or all users who’ve removed their votes.

It looks as though the query to determine who voted happens here, but when I run that query directly using Data Explorer, my name isn’t included. I’ve also validated that the post in question has no votes or votes_archive records in user_custom_fields for my user, so I suspect this is a JS display issue.

I think this is because this.scheduleRerender() isn’t being called after the removeVote() ajax request returns. I’ve opened a PR to resolve this; in this PR, I’ve also moved this.scheduleRerender() so that it’s always called at the end of the addVote() ajax promise resolution.

https://github.com/discourse/discourse-voting/pull/26

3 לייקים

Solved as per the PR above.