kiesraad / abacus

Abacus, software voor verkiezingsuitslagen en zetelverdeling
https://kiesraad-abacus.pages.dev
European Union Public License 1.2
8 stars 2 forks source link

Epic: resume data entry #137

Open praseodym opened 2 months ago

praseodym commented 2 months ago

TODO

jorisleker commented 1 week ago

@praseodym:

Is showing unfinalized data entries for the current user on the select polling station page part of this epic (see Figma)?

And regarding the latter, when do we consider a data entry to be associated to a user? I would say after they click 'beginnen' on the select polling station page. Right now, it's only linked to a user after the submit their first data (click 'volgende' on the recounted page). I think that's too late.

jorisleker commented 1 week ago

Maybe: Avoiding conflicting saves from multiple clients e.g. by working with timestamp: frontend sends timestamp of previous save to backend, backend cancels save when timestamp is older than current save in database, which means that backend was updated by other client and this client state is out of date.

Should'nt we prevent accepting posts from multiple users? The user that started the data entry should be the only one allowed to update it? Doesn't really solve the 'multiple clients' issue, unless we prevent users from logging in on multiple devices (which sounds like a smart idea anyway. We don't want a data typist to use more then 1 machine).

praseodym commented 1 week ago

@praseodym:

Is showing unfinalized data entries for the current user on the select polling station page part of this epic (see Figma)?

Yes it is.

And regarding the latter, when do we consider a data entry to be associated to a user? I would say after they click 'beginnen' on the select polling station page. Right now, it's only linked to a user after the submit their first data (click 'volgende' on the recounted page). I think that's too late.

Indeed, we should 'claim the data entry' as soon as 'Beginnen' is clicked, also to prevent conflicts (what if another user has started in the meantime?).

Maybe: Avoiding conflicting saves from multiple clients e.g. by working with timestamp: frontend sends timestamp of previous save to backend, backend cancels save when timestamp is older than current save in database, which means that backend was updated by other client and this client state is out of date.

Should'nt we prevent accepting posts from multiple users? The user that started the data entry should be the only one allowed to update it? Doesn't really solve the 'multiple clients' issue, unless we prevent users from logging in on multiple devices (which sounds like a smart idea anyway. We don't want a data typist to use more then 1 machine).

Of course a single data entry by multiple users shouldn't be possible at all. But multiple clients on a single machine with a single user can occur by opening multiple windows/tabs on the same machine, and my suggestion above would also prevent that from creating undefined behaviour.

jschuurk-kr commented 1 day ago

@praseodym In our July retro we decided to have two owners per epic. Who is your co-owner for this one?