Page MenuHomePhabricator

Check on TallyPage.php for tally results and display them
Closed, ResolvedPublic3 Estimated Story Points

Description

Update TallyPage to show one of 3 states (form; message that tallying is underway; election results).

Form should always show, so that a re-tally can be triggered.

Event Timeline

STran set the point value for this task to 3.Mar 11 2021, 7:50 PM

Change 673601 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/SecurePoll@master] WIP Introduce job for tallying large encrypted elections

https://gerrit.wikimedia.org/r/673601

@Prtksxna The WIP patch uses the following workflow - would be great to hear your thoughts on both the workflow and the design

(Note that this is only for large encrypted elections; small elections and un-encrypted elections work as before.)

If the election has never been tallied before:

image.png (299Γ—725 px, 19 KB)

After submitting the tally form:

image.png (46Γ—698 px, 5 KB)

While the tally is ongoing:

image.png (316Γ—722 px, 24 KB)

Once the tally has finished:

image.png (340Γ—725 px, 25 KB)

If a tally has been completed, but another tally has been started since and is still ongoing:

image.png (371Γ—725 px, 30 KB)

image.png (371Γ—725 px, 30 KB)

@Prtksxna In case it's not clear, the results of this particular election are: "What do you like best One | 1026". This is roughly how tally results currently display.

This can definitely be improved, but it would be a significant bit of work to do that, since there are different types of election with different types of results data, so we'd need a design for each one. I'd suggest we do that as part of the next round of SecurePoll improvements.

Following a meeting with @Prtksxna, some design improvements:

  • Heading for Results
  • Move tallying progress state to an β€˜alert’ and move it to the top
  • Put the form inside a box

@Prtksxna - how's this?

OldNew
image.png (371Γ—725 px, 30 KB)
image.png (389Γ—728 px, 32 KB)

@Tchanders, yep this is looking great, exactly what I had in mind. A few notes:

  1. Do you think it is warranted to bring more attention to the 'alert'? If yes, we could use the yellow variant for it. If not, this is good.
  2. The GPG decryption key textarea would still be there, right?

Could you share one page for unencrypted elections? I am guessing just a button in a fieldset is going to look a bit odd.

Do you think it is warranted to bring more attention to the 'alert'? If yes, we could use the yellow variant for it. If not, this is good.

Good point - have used the yellow 'warning' message. Also a red 'error' message if the tally has failed.

The GPG decryption key textarea would still be there, right?

Yes, it should always be there when needed.

Could you share one page for unencrypted elections? I am guessing just a button in a fieldset is going to look a bit odd.

Good point - the box is being added conditionally now, so not for the unencrypted elections.

Example screenshots (ignore the disappearing/reappearing encryption field):

image.png (386Γ—729 px, 32 KB)
image.png (533Γ—726 px, 38 KB)

Unencrypted election:

image.png (126Γ—722 px, 7 KB)

the box is being added conditionally now, so not for the unencrypted elections.

Perfect.

The example screenshots are looking good πŸ‘πŸΎ

Change 673601 merged by jenkins-bot:
[mediawiki/extensions/SecurePoll@master] Tally elections via DeferredUpdate to avoid timeout

https://gerrit.wikimedia.org/r/673601

@Niharika @jrbs After the results are successfully tallied, the tallied results will be stored in the XML dump, so anyone can view them. Just checking this is OK.

@Niharika @jrbs After the results are successfully tallied, the tallied results will be stored in the XML dump, so anyone can view them. Just checking this is OK.

IMO this is fine, given I think all elections run with this tool have their results made public anyway.

beta votewiki wasn't letting me login for a couple of days (T263617), so I had to do most of my testing on docker. I successfully managed to tally an election with 1000 votes on docker, and 300 votes on beta.

Tested for encrypted elections of type Approval, Schulze, Plurality, Range Plurality and Range Histogram, one unencrypted election and an election which already had its decryption key uploaded.

Once the tallying job is complete, the results appear below the tallying form:

successful_tally_unencrypted.png (369Γ—556 px, 27 KB)

If the tallying job leads to an error, the error displays above the tally form, and stays there until the next time the election is successfully tallied:

error_tally_invalid_gpg.png (552Γ—1 px, 92 KB)

(Note, I think the error message is incorrectly encoded when recorded in the database. Raised T278921, but I don't think it will affect production as it does not show tally errors $wgSecurePollShowErrorDetail.)

As Thalia points out in the commit, the deferred tallying does not happen when uploading an XML dump:

The deferred update can't be used for elections that are uploaded via an XML dump since it is not clear where to return to for the results. The possibility of a timeout error therefore remains, if a user uploads a large election. However, this feature is rarely used and may be removed.

Test Environment: local docker (sqlite) SecurePoll 2.0.0 (ed8bc5e) 06:37, 29 March 2021.