More notification metrics fixes (#26889)

* Explicitly have the client tell the server when it should expect an ACK

* Don't count missing profile errors for your own posts, added comment

* Fix test

* Make postedAck a parameter in WebSocketClient

* Snapshot fixes

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Devin Binnie
2024-04-25 15:07:12 -04:00
коммит произвёл GitHub
родитель 5f1a357845
Коммит 60c15c821f
9 изменённых файлов: 44 добавлений и 24 удалений

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

@@ -87,8 +87,9 @@ func TestPostedAckHook_Process(t *testing.T) {
hook := &postedAckBroadcastHook{}
userID := model.NewId()
webConn := &platform.WebConn{
UserId: userID,
Platform: &platform.PlatformService{},
UserId: userID,
Platform: &platform.PlatformService{},
PostedAck: true,
}
webConn.SetSession(&model.Session{})
@@ -140,12 +141,12 @@ func TestPostedAckHook_Process(t *testing.T) {
assert.True(t, msg.Event().GetData()["should_ack"].(bool))
})
t.Run("should not ack for mobile app", func(t *testing.T) {
t.Run("should not ack if posted ack is false", func(t *testing.T) {
mobileWebConn := &platform.WebConn{
UserId: userID,
Platform: &platform.PlatformService{},
UserId: userID,
Platform: &platform.PlatformService{},
PostedAck: false,
}
mobileWebConn.SetSession(&model.Session{Props: map[string]string{"isMobile": "true"}})
msg := platform.MakeHookedWebSocketEvent(model.NewWebSocketEvent(model.WebsocketEventPosted, "", "", "", nil, ""))
hook.Process(msg, mobileWebConn, map[string]any{