[MOT-558] fix: failed ai move leaving game stuck#32
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| </DialogHeader> | ||
| <div className="flex flex-col gap-6 w-full items-center justify-center"> | ||
| <p className="text-center">Oops! Something went wrong, would you like to retry the last move?</p> | ||
| <Button | ||
| data-testid="retry-move-button" | ||
| variant="default" | ||
| className="h-12 w-fit" | ||
| onClick={onRetryClick} | ||
| > | ||
| <RotateCcw className="size-5" /> <span>Retry last move</span> | ||
| </Button> | ||
| </div> |
There was a problem hiding this comment.
This leads to critical race condition.
|
Solved this one with a limit of 10 minutes per game session, then after refreshing, ChessArena will create a new game session. I'm closing this PR since it has some critical issues around race conditions that are really hard to solve. |
I can't replicate the race condition you are mentioning due to the Dialog to retry the last step. Can you provide more details of what steps you took that lead you to that, please? I checked the 10 minute timeout but this won't solve scenarios where a human is playing vs AI and the AI move failed due to the prompt failing to process (see attached demo). It also assumes someone will refresh the page or for someone else to enter the game, which won't be the case for human vs ai always. I'm reopening this PR for now until we can discuss further. |
|
if two users click the replay button at the same time it will trigger the execution twice while we don't have FIFO queues we can't do this, unfortunately |
Why?
AI vs AI games are stuck on the last move when the prompt execution fails for any reason
What?
Demo
https://www.veed.io/view/b5da0eaa-ae4c-407a-9ca6-786bc3ca9ad1?panel=share