MM-43137: Fix racy test TestUpdateActiveBotsSideEffect (#19935)

This was introduced with 2e027ae927.

We fix it by deep copying the user struct before returning from store.

https://mattermost.atlassian.net/browse/MM-43137

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-04-07 19:21:06 +05:30
коммит произвёл GitHub
родитель 762caaeb51
Коммит f93d6d5687

Просмотреть файл

@@ -224,7 +224,7 @@ func (us SqlUserStore) Update(user *model.User, trustedUpdateData bool) (*model.
user.Sanitize(map[string]bool{})
oldUser.Sanitize(map[string]bool{})
return &model.UserUpdate{New: user, Old: &oldUser}, nil
return &model.UserUpdate{New: user.DeepCopy(), Old: &oldUser}, nil
}
func (us SqlUserStore) UpdateNotifyProps(userID string, props map[string]string) error {