Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle shared election page closing or going to local election #74

Open
18 tasks
V-ed opened this issue Jan 7, 2020 · 1 comment
Open
18 tasks

Handle shared election page closing or going to local election #74

V-ed opened this issue Jan 7, 2020 · 1 comment
Assignees

Comments

@V-ed
Copy link
Member

V-ed commented Jan 7, 2020

This is a continuation of PR #68

TODOs

  • Handle user leaving current page
    • Send request (beacon) when leaving page to tell the server a user has left, so a new seat should be available if it was taken and not fulfilled
  • Allow to return to an ongoing shared election if page was closed
    • In this special case, the shared election code should be added to the data
    • When loading that data with a shared election code, delete the code from the data
    • Verify to not take another seat when loading the election if a seat was already taken
    • Add loading icon when making request
    • Add request errors handling
      • If election not reachable, propose to do it locally instead
    • If election already ended, propose to either go to results or to do this saved election locally
      • The option to go to the results would be the primary action
  • Allow post-shared-election-view to force a seat to be freed
    • This would be helpful if a device that had a seat simply dies or skips locally.
    • The action would always be enabled, as there may be a complete internet outage for one of th devices that had its seat locked locally, so the server may not know that the seat can be leased. The assumption is therefore always allow leasing under your own risks.
    • Add a confirmation that explains that this action is dangerous
      • The severity if the server knows there are at least one leased seat is less severe, but still warn user
      • The severity if the server thinks there are no leased seats is very high, as there might be other voters currently in progress
    • Add request errors handling
      • If errors, mentions that you can simply go to current local data, mentionning that verifying will also download the latest candidates data
@V-ed V-ed self-assigned this Jan 7, 2020
@V-ed
Copy link
Member Author

V-ed commented Feb 17, 2020

The data object would have a new field, named currentlyHasSeat that would track if the current election has a seat taken. This will be used to load the election back again if the connection is broken.


Actually... thinking about it, we already kinda handle problems of sending votes by storing the votes array in a temporary variable and querying that variable in the go_to_next_voter method...

I should just simply use that variable to try again on load if there were errors! That variable should therefore be added to the data when there is errors, so I can handle it later on. Don't take a seat, just send the votes that were saved on error (maybe after confirmation?).

That would actually fix all the things! Maybe you shouldn't even need that much of a lease-seat after all! But it would be useful if a device dies, not only that it loses internet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant