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
- Vote twice on an election with the same user
- Go to Special:SecurePoll/list/$id
- Strike the user's most recent vote
- 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.