MM-25595 - Edits to bot username and display name fail to save (#14699)
* invalidate the user profile cache bc we know it's now outdated * invalidate cache when updating user roles; test * tests fix -- experimental * fixing linter errors * revert to original solution Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
19e5afd607
Коммит
7bba8db65f
@@ -89,6 +89,7 @@ func (a *App) PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
a.InvalidateCacheForUser(user.Id)
|
||||
|
||||
ruser := userUpdate.New
|
||||
a.sendUpdatedUserEvent(*ruser)
|
||||
|
||||
@@ -1395,8 +1395,8 @@ func (a *App) UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent
|
||||
|
||||
schan := make(chan store.StoreResult, 1)
|
||||
go func() {
|
||||
userId, err := a.Srv().Store.Session().UpdateRoles(user.Id, newRoles)
|
||||
schan <- store.StoreResult{Data: userId, Err: err}
|
||||
id, err := a.Srv().Store.Session().UpdateRoles(user.Id, newRoles)
|
||||
schan <- store.StoreResult{Data: id, Err: err}
|
||||
close(schan)
|
||||
}()
|
||||
|
||||
@@ -1411,7 +1411,7 @@ func (a *App) UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent
|
||||
mlog.Error("Failed during updating user roles", mlog.Err(result.Err))
|
||||
}
|
||||
|
||||
a.InvalidateCacheForUser(user.Id)
|
||||
a.InvalidateCacheForUser(userId)
|
||||
a.ClearSessionCacheForUser(user.Id)
|
||||
|
||||
if sendWebSocketEvent {
|
||||
|
||||
Ссылка в новой задаче
Block a user