Skip to content

check mobile sri in Challenge.isMine#20101

Merged
ornicar merged 3 commits intolichess-org:masterfrom
tom-anders:fix-mobile-anon-challenges
Mar 27, 2026
Merged

check mobile sri in Challenge.isMine#20101
ornicar merged 3 commits intolichess-org:masterfrom
tom-anders:fix-mobile-anon-challenges

Conversation

@tom-anders
Copy link
Copy Markdown
Contributor

@tom-anders tom-anders commented Mar 26, 2026

The mobile app uses the following flow to create challenge links to send to other players:

  1. Create an open challenge via /api/challenge/open
  2. Immediately accept it via /api/challenge/<id>/accept
  3. Share the challenge link and listen to the challenge websocket to get notified when a user accepts
  4. Once another user accepts, call /api/challenge/<id>/show to get the full ID of the created game

Without this change, if the challenge link was accepted as anonymous, in step 4) the endpoint would return the player ID of the user that accepted the challenge, not the one that created it, because isMine would incorrectly return false. With this change, isMine correctly returns true in this case and the app gets the correct ID, even if the challenge was created anonymously.

@tom-anders tom-anders requested a review from ornicar March 26, 2026 19:36
Copy link
Copy Markdown
Contributor Author

@tom-anders tom-anders Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ornicar Can you also change this endpoint to AnonOrScoped? Claude gave me something that compiled and seemed to work, but I'm not comfortable enough yet in Scala to add it to the PR

@ornicar ornicar force-pushed the fix-mobile-anon-challenges branch from c2d6906 to ebc18b0 Compare March 27, 2026 07:28
@ornicar
Copy link
Copy Markdown
Collaborator

ornicar commented Mar 27, 2026

✔️ compiles
❎ tested

@ornicar ornicar merged commit a42ea37 into lichess-org:master Mar 27, 2026
7 checks passed
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.

2 participants