MM-33913: Fix read-after-write issues with team member (#17173)
During LDAP sync, we would call AddTeamMember which had a read-after-write issue where we would create a team member but then immediately after that query the team member. The same pattern was found in: AddTeamMember AddTeamMembers AddTeamMemberByToken To fix this, we just return the inserted team member from AddUserToTeam and use that instead of query GetTeamMember again. ```release-note NONE ``` https://mattermost.atlassian.net/browse/MM-33913 Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
02196e04fa
Коммит
4f0cfbe329
@@ -378,7 +378,7 @@ func TestCreateUserWebSocketEvent(t *testing.T) {
|
||||
guest, err := th.App.CreateGuest(guest)
|
||||
require.Nil(t, err)
|
||||
|
||||
_, err = th.App.AddUserToTeam(th.BasicTeam.Id, guest.Id, "")
|
||||
_, _, err = th.App.AddUserToTeam(th.BasicTeam.Id, guest.Id, "")
|
||||
require.Nil(t, err)
|
||||
|
||||
_, err = th.App.AddUserToChannel(guest, th.BasicChannel)
|
||||
|
||||
Ссылка в новой задаче
Block a user