🐛 Bug Report: Appwrite interface, user preferences
👟 Reproduction steps
When I go to a authed user-> /console/
👍 Expected behavior
It should delete the preference for the user
👎 Actual Behavior
It did nothing -> proof when reloading
🎲 Appwrite version
Version 1.2.x
💻 Operating system
Linux
🧱 Your Environment
No response
👀 Have you spent some time to check if this issue has been raised before?
- [X] I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- [X] I have read the Code of Conduct
Seems like there's a few other bugs with regards to updating user preferences.
- If there's more than 1 preference in the console for a user, the all preferences except the first one can be deleted as expected.
- If there's exactly 1 preference in the console for a user, that preference cannot be deleted as the
Updatebutton stays disabled. - If there's more than 1 preference in the console for a user, clicking the
Xicon for the first preference gets rid of all the preferences for that user (only in the UI), and theUpdatebutton stays disabled in this case as well.
I've tried attaching screen caps to demonstrate this.
P.S. GitHub video previews have always been weird for me. If it seems like nothing is happening in the videos, just scroll back to the start and it'll work.
Case 1
Even though I deleted them from bottom to top in this preview, it doesn't have to be done that way in this case.
https://user-images.githubusercontent.com/19154530/228349252-82c0b497-ae14-4449-badb-cf1a53e2d17b.mp4
Case 2
https://user-images.githubusercontent.com/19154530/228349207-de5aed1e-e612-4567-9bdb-198a8588dbef.mp4
Case 3
https://user-images.githubusercontent.com/19154530/228349031-e5cd288e-363e-4d5c-bd45-19071280d370.mp4
I'd love to work on this issue and create a PR. Let me know if possible!
It seems like a really simple fix to be honest.
@Maettis thanks for raising this! 🙏🏼
@safwanyp this might have been fixed already, but let me double check with the team.
@safwanyp looks like it hasn't. Assigned!
@stnguyen90 Great, thanks!
@stnguyen90 pinging to inform you that i just made the PR.
Thank you, our team will review your PR as soon as possible.
Update: There seems to be also the case for whitespaces. Using " " (spaces) for both key and value allows saving the preferences.
https://github.com/appwrite/appwrite/assets/20625965/2a894283-8b18-4904-aa4c-8041759d32c9
Not sure, why we can not update the preference via console... may be this might be related to this itself?
PR: https://github.com/appwrite/console/pull/696
https://github.com/appwrite/appwrite/assets/3280475/9b993314-ca43-4e3c-8180-1f5eb3b9089f
Preferences are typed internally, but using the console to change them converters them all to strings. Type-column in the table is needed, it's not a case of "if the comment get enough votes". This can break stuff!
Dangrous stuff:
- Booleans that you think you set to
falseis really set to"false"which is consideredtruein javascript - Numbers that you think you set to
10is really set to"10"which might crash some calculation
#8989 #8989