[MM-55485] Ensure user added to channel receives websocket event regardless of channel membership info retrieved in HA (#27013)
* [MM-55485] Ensure user added to channel receives websocket event regardless of channel membership info retrieved in HA * Testing to see if group messages are also affected * Use context from master approach * Hardcode to master to test * Revert "Hardcode to master to test" This reverts commit 50ef2baed1559861367d9c3b4cea74c21b4b9fd1. * Revert "Use context from master approach" This reverts commit 65d3584f83559554213cd9c726258d80775bc8bd. * Remove group message changes, add comment --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7d7b203567
Коммит
8f95656c8f
@@ -1597,11 +1597,19 @@ func (a *App) AddUserToChannel(c request.CTX, user *model.User, channel *model.C
|
||||
return nil, err
|
||||
}
|
||||
|
||||
message := model.NewWebSocketEvent(model.WebsocketEventUserAdded, "", channel.Id, "", nil, "")
|
||||
// We are sending separate websocket events to the user added and to the channel
|
||||
// This is to get around potential cluster syncing issues where other nodes may not receive the most up to date channel members
|
||||
// There is likely some issue syncing these that needs to be looked at, but this is the current fix.
|
||||
message := model.NewWebSocketEvent(model.WebsocketEventUserAdded, "", channel.Id, "", map[string]bool{user.Id: true}, "")
|
||||
message.Add("user_id", user.Id)
|
||||
message.Add("team_id", channel.TeamId)
|
||||
a.Publish(message)
|
||||
|
||||
userMessage := model.NewWebSocketEvent(model.WebsocketEventUserAdded, "", channel.Id, user.Id, nil, "")
|
||||
userMessage.Add("user_id", user.Id)
|
||||
userMessage.Add("team_id", channel.TeamId)
|
||||
a.Publish(userMessage)
|
||||
|
||||
return newMember, nil
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user