Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggling Picture and Avatar Configuration switches have no effect #22332

Closed
strk opened this issue Jan 3, 2023 · 4 comments · Fixed by #22333
Closed

Toggling Picture and Avatar Configuration switches have no effect #22332

strk opened this issue Jan 3, 2023 · 4 comments · Fixed by #22333
Labels
Milestone

Comments

@strk
Copy link
Member

strk commented 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

@strk strk added the type/bug label Jan 3, 2023
@strk
Copy link
Member Author

strk commented 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
Copy link
Member Author

strk commented Jan 3, 2023

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

@lunny
Copy link
Member

lunny commented Jan 3, 2023

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

@strk
Copy link
Member Author

strk commented Jan 3, 2023

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

@lunny lunny added this to the 1.18.1 milestone Jan 4, 2023
lunny added a commit that referenced this issue Jan 8, 2023
Unfortunately, #22295 introduced a bug that when set a cached system
setting, it will not affect.
This PR make sure to remove the cache key when updating a system
setting.

Fix #22332
lunny added a commit to lunny/gitea that referenced this issue Jan 8, 2023
Unfortunately, go-gitea#22295 introduced a bug that when set a cached system
setting, it will not affect.
This PR make sure to remove the cache key when updating a system
setting.

Fix go-gitea#22332
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants