MM-43340: Fix racy test TestGraphQLChannelMembers (#19968)

We take a shallow copy of the team pointer before
we pass that to the other functions.

This is because the resolvers run in separate
goroutines.

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

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-04-13 18:50:33 +05:30
коммит произвёл GitHub
родитель 1198191a1c
Коммит c0b2aae84e
2 изменённых файлов: 7 добавлений и 0 удалений

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

@@ -30,6 +30,7 @@ func getGraphQLTeam(ctx context.Context, id string) (*model.Team, error) {
return nil, err
}
team := result.(*model.Team)
team = team.ShallowCopy()
if (!team.AllowOpenInvite || team.Type != model.TeamOpen) &&
!c.App.SessionHasPermissionToTeam(*c.AppContext.Session(), team.Id, model.PermissionViewTeam) {