Page MenuHomePhabricator

SecurePoll: vote_current not updated when vote struck
Closed, InvalidPublicBUG REPORT

Description

What is the problem?

If a user has voted twice and I strike the most recent vote, none of the user's votes will be included in the results tally or dump file.

Instead, we could include the user's first vote, as it has not been struck.

This happens because only the voter's most recent vote has the vote_current flag set. When this vote is struck this flag is not updated. When the election is tallied or dumped, we only include votes that are not struck and have the vote_current flag set.

Two potential solutions:

  • When striking a voter's most recent vote, set the vote_current flag on the voter's previous most recent vote
  • When tallying/dumping, look for a voter's most recent, non-struck vote via the vote_timestamp field (or similar)
Steps to reproduce problem
  1. Vote twice on an election with the same user
  2. Go to Special:SecurePoll/list/$id
  3. Strike the user's most recent vote
  4. Tally or dump the election

Expected behavior: The first vote is included in the tally results or dump file
Observed behavior: None of the user's votes are included

Environment

Wiki(s): https://vote.wikimedia.beta.wmflabs.org SecurePoll 3.0.0 (74b3b6d) 15:17, 13 August 2021.

Event Timeline

@Niharika We should check with T&S whether this behaviour is expected or not.

@jrbs Would there be a circumstance where only a voter's most recent vote is struck, but not any/all of their previous votes? What would you expect/want the behaviour to be in that circumstance?

Would you want their previous vote to be counted? Or none of them?

I think this is expected behaviour in this situation. When you vote a second (or third, etc) time, you are doing so with the assumption that your previous vote will be discarded. The software presently alerts you to this fact when you arrive at the ballot after having already voted. Therefore, your "current" vote is for all intents and purposes your only vote.

So while it's perhaps counterintuitive, I think it makes sense for there to be no valid votes at all for a username if the most recent vote from that username is struck.

@dom_walden thanks for catching that.

@jrbs thanks -- that makes sense. The previous votes are discarded once the voter votes again.

Closing this ticket as Invalid. Please reopen if there's any objections. :)