Open V-ed opened 4 years ago
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.
This is a continuation of PR #68
TODOs