bjornregnell / sigrid

Help queue web app for lab sessions and tutorials.
Apache License 2.0
10 stars 5 forks source link

Check that the server state is consistent with client state on pop #18

Open hnrklssn opened 4 years ago

hnrklssn commented 4 years ago

Currently a tutor may accidentally (and unknowingly) pop a student waiting for help if they person first in the queue has already removed themselves from the queue. The tutor might miss this if they haven't updated the page first, or if they remove themselves from the queue just before the pop. This then leads to the tutor not realising they skipped someone in the queue, and the student thinking they are still in the queue, potentially waiting for a very long time before noticing that they are no longer in line for help.

This could be fixed by passing the id of the student the client thinks is in front of the queue with the POST-request, and if this does not match what the server thinks is the front of the queue, the pop is not performed. Basically a "compare and set" call.

I might have a go at implementing this sometime early next year if it hasn't already been fixed by then.