MM-34002: Improve AddUserToChannel (#17174)
* MM-34002: Improve AddUserToChannel When we would add a user to a channel, we would check whether the user is removed from that team or not. During LDAP sync, this check is not required because the team member would have just been created. Hence, we pass a boolean flag to bypass the check. And with that done, we can freely query the replica. https://mattermost.atlassian.net/browse/MM-34002 ```release-note NONE ``` * Refactor code * Rename a struct field * fix double negative
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4f0cfbe329
Коммит
db01f2a91b
@@ -381,7 +381,7 @@ func TestCreateUserWebSocketEvent(t *testing.T) {
|
||||
_, _, err = th.App.AddUserToTeam(th.BasicTeam.Id, guest.Id, "")
|
||||
require.Nil(t, err)
|
||||
|
||||
_, err = th.App.AddUserToChannel(guest, th.BasicChannel)
|
||||
_, err = th.App.AddUserToChannel(guest, th.BasicChannel, false)
|
||||
require.Nil(t, err)
|
||||
|
||||
guestClient := th.CreateClient()
|
||||
@@ -5151,11 +5151,11 @@ func TestGetKnownUsers(t *testing.T) {
|
||||
th.LinkUserToTeam(u3, t2)
|
||||
th.LinkUserToTeam(u4, t3)
|
||||
|
||||
th.App.AddUserToChannel(u1, c1)
|
||||
th.App.AddUserToChannel(u1, c2)
|
||||
th.App.AddUserToChannel(u2, c1)
|
||||
th.App.AddUserToChannel(u3, c2)
|
||||
th.App.AddUserToChannel(u4, c3)
|
||||
th.App.AddUserToChannel(u1, c1, false)
|
||||
th.App.AddUserToChannel(u1, c2, false)
|
||||
th.App.AddUserToChannel(u2, c1, false)
|
||||
th.App.AddUserToChannel(u3, c2, false)
|
||||
th.App.AddUserToChannel(u4, c3, false)
|
||||
|
||||
t.Run("get know users sharing no channels", func(t *testing.T) {
|
||||
_, _ = th.Client.Login(u4.Email, u4.Password)
|
||||
|
||||
Ссылка в новой задаче
Block a user