lemmy
lemmy copied to clipboard
[Bug]: {"error":"user_already_exists"} when saving user settings without avatar
Requirements
- [X] Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
- [X] Did you check to see if this issue already exists?
- [X] Is this only a single bug? Do not put multiple bugs in one issue.
- [X] Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.
Summary
PUT /api/v3/user/save_user_settings requires avatar or else it fails error code 400 with {"error":"user_already_exists"}
Steps to Reproduce
-
PUT/api/v3/user/save_user_settingswith payload{"show_nsfw":false,"auth":"{insert_jwt_here"} - Observe error code 400 with
{"error":"user_already_exists"}
Adding avatar field causes the request to succeed.
Request should not require avatar
Technical Details
Please see above.
Version
0.18.1
Lemmy Instance URL
lemmy.world
I think the problem is that there are two DB transactions in the SaveUserSettings call. one for person and one for local_user. For it not to fail, it seems that a value of one of the two structures needs to change (i.e. at least one of {display_name,bio,matrix_user_id,bot_account,avatar,banner} and one of the remaining fields).
https://github.com/LemmyNet/lemmy/pull/4077