DOMjudge / domjudge

DOMjudge programming contest jury system
https://www.domjudge.org
GNU General Public License v2.0
732 stars 256 forks source link

First to solve rejudging #2105

Closed mzuenni closed 1 year ago

mzuenni commented 1 year ago

Description of the problem

There can be multiple persons with "first to solve" on the scoreboard due to rejudgings

Your environment

DOMjudge 8.3.0DEV/5d0968d34

Steps to reproduce

Expected behaviour

Only the first person gets the "first to solve" on the scoreboard after the rejudging

Actual behaviour

Both get the "first to solve" on the scoreboard after the rejudging

nickygerritsen commented 1 year ago

I don't follow. Why would the second still have the first to solve? The other team is now later, isn't it?

mzuenni commented 1 year ago

that is the bug. The later team should no longer have it... but the scoreboard still shows it for some reason

nickygerritsen commented 1 year ago

I think we don’t update the score cache of untouched teams. We might want to but it will slow down the applying

mzuenni commented 1 year ago

Yes, refreshing the scoreboard cache solves the issue.

nickygerritsen commented 1 year ago

We recently changed the logic in the code to only update the scoreboard cache at the end of applying a rejudging (#2099). Should we maybe, instead of that, do a full scorecache update for all teams in the contest for any 'touched' problem? That would solve this.

meisterT commented 1 year ago

cc @thijskh who might understand the first to solve code (and implicit contract) the best

nickygerritsen commented 1 year ago

I gave this a try in #2127. I first added a test (which of course failed), implemented the change and saw the test turn green. Isn't it magic?