peerreview
peerreview copied to clipboard
[BUG] Race Condition in the Paper Events Timeline
Describe the bug
Describe the bug you encountered. What happened? What did you expect to happen?
When committing an in-progress event (paper comment, review) it is possible to have the commit fire, one of the getEvents polls return, and then the commit return in that order. When that happens the front end will get out of sync with the backend and duplicate events can appear on the timeline. It's very difficult to trigger this race condition - the easiest way to do it is to essentially spam paper comments as fast as you can - because it depends on the GET /events poll returning in the middle of the PATCH request that commits the in-progress event. But it is pretty consistently triggerable.
Fixing this probably involves completely refactoring how we're handling requests, or completely refactoring how we're handling in progress events. So.. we're punting for the moment since it is pretty hard to trigger. But we really should fix this before we begin private beta, because it's a pretty obnoxious bug.
To Reproduce
Please describe the exact steps required to reproduce the bug.
- Find a paper you can comment on.
- Spam comments as fast as you can.
- Eventually, a comment you just submitted will repopulate the comment form.