peerreview icon indicating copy to clipboard operation
peerreview copied to clipboard

[BUG] Race Condition in the Paper Events Timeline

Open danielBingham opened this issue 9 months ago • 0 comments

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.

  1. Find a paper you can comment on.
  2. Spam comments as fast as you can.
  3. Eventually, a comment you just submitted will repopulate the comment form.

danielBingham avatar Nov 02 '23 19:11 danielBingham