A few minutes ago, I saw a
9x9 2m+0x 10s
challenge at the Play page.
(I noted the player’s name too, but figure I shouldn’t post that part here.)
Even if 0 periods is to be allowed, I would think that should warn as Unusual Time Setting.
(Does 2 minutes sudden death give that warning? These two time-settings are equivalent.)
I see that at the page joooom linked to, anoek said
we have this line in our backend sanitization ret["periods"] = min(300, max(1, int( time_control_parameters["periods"] or "0")))
.
Is that Python 3? If yes, what happens with a ValueError from int()?
(For example, it could be that, due to this being live code, something will
use 0 rather than halting if it gets a KeyError for ret["periods"].)
I saw another one, this time
9x9 5m+nullx 30s .
I believe Python has “None” rather than “hull”, so here are two hypotheses:
the Python hypothesis:
time_control_parameters["periods"] is NaN, or something else truthy that
would cause int to raise ValueError. (I know that in Python 3, NaN is truthy.)
Since the left input is truthy, the or outputs that, and then int accordingly raises ValueError. That exception stops the execution of that Python code, leaving null,
or something that gets treated as such, in whatever location your other code
- maybe something like C++, maybe database code - reads to get ret["periods"].
the something-else hypothesis:
time_control_parameters["periods"] is either null or NaN or NA or something similar, and is truthy.
Since time_control_parameters["periods"] is truthy, that is the output of the or. int of that is null. max and min both output null when one of their inputs is null.
Ran into a case of a lot of games being created currently, with timesettings like 30 seconds + null x 2s or null x 3s byo-yomi, resulting in a player rank-inflating a lot (many, many timeout wins) – is that considered exploiting a bug ? Should it be reported (either for the bug or the exploiting) ?
This goes back years, well before this thread was created. It has been discussed by mods, and nothing was done, so it is either an intractable bug, or it is intentionally allowed.
I think certain pull requests were merged to fix it, but I think one issue was to do with caching settings.
For example if the browser remembered that you were able to create settings with null byoyomi it would still be filled and you could request it. It could also be an issue if you saved such settings.
On the other hand, I thought the backend was suggested to be updated so that it just rejects those settings, but I think that probably wasn’t done, given people seem to be able to still create these games.