`/account/preferences` soundSet enum returns an upper-case value instead of a lower-case one as the doc states, for first-time accounts
alexrintt opened this issue · 1 comments
alexrintt commented
https://lichess.org/api#tag/Account/operation/account.
How to reproduce
- Create a new Lichess account.
- Verify your email address.
- Create a personal access token with read access to your preferences.
- Call
curl --request GET --url https://lichess.org/api/account/preferences --header "Authorization: Bearer <your-personal-access-token-here>"
. - See
prefs.soundSet
key. - You'll see the key set as "Standard", not as "standard" as the documentation states (see below).
If you update your preference to some other soundKey enum option and set again to "standard", you will see that the enum key will be fixed.
Note: use this token: lip_cgTTCykZg0App0jTJa9o
to test the 3. step without needing to create a new acc, it has preferences:read
scope.
From: https://lichess.org/api#tag/Account/operation/account:
soundSet is a string enum: "silent" "standard" "piano" "nes" "sfx" "futuristic" "robot" "music" "speech".
Tried to find the controller that is causing this issue, but I don't know Scala, so I could only try to understand the semantics of the code:
- https://github.com/lichess-org/lila/blob/d3190bcf4880b8f53d9f62489a36ce1584cc0f23/app/controllers/Pref.scala#L22
- https://github.com/lichess-org/lila/blob/d3190bcf4880b8f53d9f62489a36ce1584cc0f23/modules/pref/src/main/PrefApi.scala#L41
- https://github.com/lichess-org/lila/blob/d3190bcf4880b8f53d9f62489a36ce1584cc0f23/modules/pref/src/main/Pref.scala#L90
- https://github.com/lichess-org/lila/blob/d3190bcf4880b8f53d9f62489a36ce1584cc0f23/modules/pref/src/main/SoundSet.scala#LL11C30-L11C38
niklasf commented
Thanks for reporting. The inconsistency will be fixed with the next update.