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

sync should hide, not delete, removed elections #74

Open
jberkus opened this issue Sep 27, 2022 · 1 comment
Open

sync should hide, not delete, removed elections #74

jberkus opened this issue Sep 27, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@jberkus
Copy link
Member

jberkus commented Sep 27, 2022

Currently, if an election is deleted from the repository, all records associated with that election get purged from the Elekto database. While this makes testing elekto simple, as well as doing data purging, it has the problem that -- unlike in Git -- the deletion is not reversible.

As such, we should adopt the new workflow for sync:

  1. User deletes election from repo
  2. sync receives repo change
  3. sync finds election in DB that is no longer in repo
  4. sync checks if that election has any voters
    5.a. if no voters, the election is deleted as it is at present
    5.b. if voters, the election is flagged "removed" but not deleted

And this one for when elections are added:

  1. User adds election to repo
  2. sync receives repo change
  3. sync looks for removed election in DB that matches the "new" election name
    4.a. if found, that election is unflagged as not removed
    4.b. if not found, new election record is created

This workflow would prevent accidentally purging ballots because you accidentally changed the election name in the repository, something that has happened to actual users. The following work is required for this:

  • add "removed" or "current" boolean flag to the elections table
  • modify all election listing views to automatically filter removed elections
  • prevent single election view from displaying a removed election

The UX problem that this change will create is:

  • users will be unable to completely delete an election and start it over under the same name

This is a pretty substantial drawback, becuase the above is also something that real users do. The answer to that is probably #38, which might make implementing 38 a prerequisite to fixing this issue.

Discuss?

@mscherer
Copy link
Contributor

Maybe the UX to remove completly a election could be manual. For example, have a file that contain a election name, as well as the date after which we are ok to have the same election again. So someone who want to remove the election add the name and date of removal, it trigger a remove. If people just want to hide, they do not add it to the file. And if a election with the same name is added, we can check the date and see the removal expired, and it can be added again.

@jberkus jberkus added the enhancement New feature or request label May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants