pepkit / pephub

A web API and database for biological sample metadata
https://pephub.databio.org
BSD 2-Clause "Simplified" License
13 stars 2 forks source link

Multiple users editing the same PEP can cause issues #309

Open nleroy917 opened 1 month ago

nleroy917 commented 1 month ago

Currently, there are no ways to mitigate the issue of two people editing one PEP at a time... the canonical example here is google docs. Multiple users can edit one Google doc simultaneously, and you can see, in real time, what's going on...

Currently, PEPhub just assumes you're the only one editing that PEP, and so it will just overwrite anything that's been written. We need a way to understand which users is on which PEP right now.

It probably (or almost certainly) will require the use of web sockets (socket.io)

nsheff commented 3 weeks ago

either websockets if you want to go with Operational Transform (OT), or you can use a check-in/check-out system, in which case websockets would not be required

nleroy917 commented 3 weeks ago

Last week (or maybe the week prior) I demo'd a basic system where we can, at the very least, indicate to users that there are other people on the same page... Kind of like how Google Sheets does it (e.g. anonymous narwhal...)

The demo will let you know if someone made a change to the sample table, but the trick is getting everything updated fast. It takes 2-3 seconds for the "save" to run. And if a lot of people are all making changes it could become unwieldy.

nleroy917 commented 3 weeks ago

The system needs re-wired at the sample level, instead of the project level for more instantaneous updates.

Bigger, problem is parallel, programmatic writing