Add guardrails for duplicate/excess answers in no-guess-queue mode. #2395
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These guardrails exist for guess-queue mode but were missing from no-guess-queue mode. This change brings parity between the two modes.
Note that:
This is not a firm guarantee against (unintended) duplicate answers, since two submissions made at ~the same time won't detect the presence of the other submission in time. Only a read-modify-write transaction would prevent this.
If duplicate answers are submitted, clearing one answer in no-guess-queue mode will mark the puzzle as incorrect and clear the answer, while leaving a correct guess in place. This is an inconsistent state. The workaround is to clear all copies of the answer and resubmit it.
See #2276