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
@@ -41,7 +41,7 @@ func TestInviteProvider(t *testing.T) {
|
||||
Description: "a test bot",
|
||||
})
|
||||
require.Nil(t, err)
|
||||
_, err = th.App.AddUserToTeam(th.BasicTeam.Id, bot2.UserId, basicUser3.Id)
|
||||
_, _, err = th.App.AddUserToTeam(th.BasicTeam.Id, bot2.UserId, basicUser3.Id)
|
||||
require.Nil(t, err)
|
||||
|
||||
bot3, err := th.App.CreateBot(&model.Bot{
|
||||
@@ -50,7 +50,7 @@ func TestInviteProvider(t *testing.T) {
|
||||
Description: "a test bot",
|
||||
})
|
||||
require.Nil(t, err)
|
||||
_, err = th.App.AddUserToTeam(th.BasicTeam.Id, bot3.UserId, basicUser3.Id)
|
||||
_, _, err = th.App.AddUserToTeam(th.BasicTeam.Id, bot3.UserId, basicUser3.Id)
|
||||
require.Nil(t, err)
|
||||
err = th.App.RemoveUserFromTeam(th.BasicTeam.Id, bot3.UserId, basicUser3.Id)
|
||||
require.Nil(t, err)
|
||||
|
||||
Ссылка в новой задаче
Block a user