Closed as6325400 closed 5 days ago
Like with the previous PR, this front-end check does not properly cover concurrent users. The check for clarification claim should happen in the same request as the submission of a clarification.
I think the best way to handle it, would be to ask for an additional form submission with confirmation if the clarification has been claimed in while typing the message.
It does happen not happen in the "same request" but on clicking submit: $body.on('submit', 'form[name=jury_clarification]'...
It does happen not happen in the "same request" but on clicking submit:
$body.on('submit', 'form[name=jury_clarification]'...
That is exactly the problem I point out, concurrent jury members handling clarifications can have interleaved requests and double replies.
If one of the jury members uses claim, then this should not happen in practice.
Also, we likely don't want to forbid double posting but make it intentional.
If one of the jury members uses claim, then this should not happen in practice.
I prefer to stay away from "should not happen in practice". My solution does not strictly guarantee it as well, but is as close as you can get with minimal changes. Also removing the need of an additional API endpoint is worth it IMHO.
Also, we likely don't want to forbid double posting but make it intentional.
Hence my suggestion to force a form resubmit, thus keeping form contents and adding an explicit warning of the claim in the meantime and asking additional confirmation for the double posting by resubmission of the form.
If one of the jury members uses claim, then this should not happen in practice.
I prefer to stay away from "should not happen in practice". My solution does not strictly guarantee it as well, but is as close as you can get with minimal changes. Also removing the need of an additional API endpoint is worth it IMHO.
See my comment above which does make the additional API endpoint unnecessary by using the existing one.
Also, we likely don't want to forbid double posting but make it intentional.
Hence my suggestion to force a form resubmit, thus keeping form contents and adding an explicit warning of the claim in the meantime and asking additional confirmation for the double posting by resubmission of the form.
I see, that works too, although it's a little bit more complex.
I accidentally closed the PR. I'll open a new one.
issue
https://github.com/DOMjudge/domjudge/issues/2481
display