Skip to content

Conversation

@AuburnMedia
Copy link
Contributor

The API was returning a truthy value when repeated draw values were being made, meaning that it looks like the API accepted the draw when sending an invalid draw offer.

We fix this by adding an error to prevent multiple draw errors within 10 moves.

Fixes #17913

AuburnMedia and others added 3 commits November 17, 2025 10:53
The API was returning a truthy value when repeated draw values were
being made, meaning that it looks like the API accepted the draw when
sending an invalid draw offer.

We fix this by adding an error to prevent multiple draw errors within 10
moves.

refs: lichess-org#17913
@ornicar
Copy link
Collaborator

ornicar commented Nov 17, 2025

Have you run your code? Checked that it fixes the issue?

@AuburnMedia
Copy link
Contributor Author

@ornicar

No local test setup currently, though the fix is pretty simple. Previously the API was returning true for all cases outside of those already handled (threefold repetition, insufficent material). Now it checks to see if the player has offered a draw recently and blocks repeated attempts, and otherwise assumes the draw failed to be sent.

@ornicar
Copy link
Collaborator

ornicar commented Nov 18, 2025

Please mention that you didn't try it, and keep the PR as a draft until you have.

@ornicar ornicar marked this pull request as draft November 18, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API: {"ok":true} when failing to offer a draw

2 participants