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
User name is not updated right away after updating "X-WEBAUTH-NAME" value #34225
Comments
This code
is calling this code which caches the signed in user data for 5 seconds grafana/pkg/services/sqlstore/user.go Line 506 in 355be15
However, when handling the actual request via Lines 14 to 17 in 355be15
grafana/pkg/services/sqlstore/user.go Line 430 in 355be15
|
i am able to reproduce the bug, seems when we fallback the name change as user2 -> user1, it doesn't take the change, but when we update user2 -> user3, it takes the change immediately, probably somewhere when we cache, we "ignore" the fallback behavior since we think it is an "outdated" data. It is a bit weird how it should work, that means a Get action would actually update the db user name. |
hey @GaryZengTurbo, thanks for reporting issue. As described before, the expected behavior is a bit confusing since we need to modify the user info in a get action, would you mind to share with us the use case when you would need to do above transactions? could you use user API to do the user info modification instead? |
Hi @ying-jeanne , Thanks for following up.
We are using Here are the details our Grafana integration use case:
|
This feels like an edge case. We'll keep this open, but are currently not planning to work on it. If anyone is interested to work on it and open a PR we're gladly helping out reviewing it. |
Hey, is this issue still open? If it is I will take a look into this. |
What happened:
Same user with updated "X-WEBAUTH-NAME" value, the name is not updated right away.
What you expected to happen:
The name should always matches the "X-WEBAUTH-NAME" value.
On the third time, the returned name is
user2
, but the "X-WEBAUTH-NAME" value isuser1
.How to reproduce it (as minimally and precisely as possible):
user1
" http://localhost:3000/api/user{"id":4,"email":"user","name":"
user1"
,"login":"user","theme":"","orgId":1,"isGrafanaAdmin":false,"isDisabled":false,"isExternal":true,"authLabels":["OAuth"],"updatedAt":"2021-05-17T14:56:53Z","createdAt":"2021-05-17T14:56:53Z","avatarUrl":"/reports/avatar/ee11cbb19052e40b07aac0ca060c23ee"}%user2
" http://localhost:3000/api/user{"id":4,"email":"user","name":"
user2
","login":"user","theme":"","orgId":1,"isGrafanaAdmin":false,"isDisabled":false,"isExternal":true,"authLabels":["OAuth"],"updatedAt":"2021-05-17T14:57:02Z","createdAt":"2021-05-17T14:56:53Z","avatarUrl":"/reports/avatar/ee11cbb19052e40b07aac0ca060c23ee"}%user1
" http://localhost:3000/api/user{"id":4,"email":"user","name":"
user2
","login":"user","theme":"","orgId":1,"isGrafanaAdmin":false,"isDisabled":false,"isExternal":true,"authLabels":["OAuth"],"updatedAt":"2021-05-17T14:57:02Z","createdAt":"2021-05-17T14:56:53Z","avatarUrl":"/reports/avatar/ee11cbb19052e40b07aac0ca060c23ee"}%Anything else we need to know?:
After waiting a while, the name will be updated eventually.
Environment:
Grafana version: v7.3.8 (1e26164)
The text was updated successfully, but these errors were encountered: