Toggling Picture and Avatar Configuration switches have no effect #10054

Closed
opened 2025-11-02 08:57:01 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @strk on GitHub (Jan 3, 2023).

Description

Toggling the Avatar switches in admin/config URL does not change the configuration as requested: reloading the page moves the switches back to their original position.

I verified the request is sent to the server, the request is also logged by the server:

2023/01/04 00:04:41 [63b4b489] router: completed POST /admin/config for 192.168.1.82:44014, 200 OK in 2.6ms @ admin/config.go:193(admin.ChangeConfig)

BUT there's no change in the database (PostgreSQL) and reloading the page shows it (switches are back to their original position)

Gitea Version

1.19.0+dev-264-g32e863439 P

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

from build tree. Cannot reproduce on try.gitea.io only because I'm not admin there, but if you grant me admin (strk) I can try

Database

PostgreSQL

Originally created by @strk on GitHub (Jan 3, 2023). ### Description Toggling the Avatar switches in admin/config URL does not change the configuration as requested: reloading the page moves the switches back to their original position. I verified the request is sent to the server, the request is also logged by the server: > 2023/01/04 00:04:41 [63b4b489] router: completed POST /admin/config for 192.168.1.82:44014, 200 OK in 2.6ms @ admin/config.go:193(admin.ChangeConfig) BUT there's no change in the database (PostgreSQL) and reloading the page shows it (switches are back to their original position) ### Gitea Version 1.19.0+dev-264-g32e863439 P ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? from build tree. Cannot reproduce on try.gitea.io only because I'm not admin there, but if you grant me admin (strk) I can try ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 08:57:01 -06:00
Author
Owner

@strk commented on GitHub (Jan 3, 2023):

Bug seems to be in func SetSetting in models/system/setting.go whereas the upsertSettingValue function is ONLY invoked when the key is not already cached in the settings cache. Sounds wrong to only conditionally upsert...

@strk commented on GitHub (Jan 3, 2023): Bug seems to be in `func SetSetting` in `models/system/setting.go` whereas the `upsertSettingValue` function is ONLY invoked when the key is not already cached in the settings cache. Sounds wrong to only conditionally upsert...
Author
Owner

@strk commented on GitHub (Jan 3, 2023):

@lunny git blame tells it was you the last to touch that SetSetting function

@strk commented on GitHub (Jan 3, 2023): @lunny git blame tells it was you the last to touch that `SetSetting` function
Author
Owner

@lunny commented on GitHub (Jan 3, 2023):

I Will take a look at it today. Thank you for your report.

@lunny commented on GitHub (Jan 3, 2023): I Will take a look at it today. Thank you for your report.
Author
Owner

@strk commented on GitHub (Jan 3, 2023):

The bug is possibly rooted in PR #22295 there's evidently an hole in testsuite regarding caches

@strk commented on GitHub (Jan 3, 2023): The bug is possibly rooted in PR #22295 there's evidently an hole in testsuite regarding caches
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10054