Invalidate webhook cache after updating webhook (#7430)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9fc7845112
Коммит
23e64ec9aa
@@ -8,6 +8,8 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/utils"
|
||||
)
|
||||
@@ -503,6 +505,9 @@ func TestUpdateIncomingHook(t *testing.T) {
|
||||
} else {
|
||||
t.Fatal("should not be nil")
|
||||
}
|
||||
|
||||
//updatedHook, _ = th.App.GetIncomingWebhook(createdHook.Id)
|
||||
assert.Equal(t, updatedHook.ChannelId, createdHook.ChannelId)
|
||||
})
|
||||
|
||||
t.Run("RetainCreateAt", func(t *testing.T) {
|
||||
|
||||
@@ -219,6 +219,7 @@ func (a *App) UpdateIncomingWebhook(oldHook, updatedHook *model.IncomingWebhook)
|
||||
if result := <-a.Srv.Store.Webhook().UpdateIncoming(updatedHook); result.Err != nil {
|
||||
return nil, result.Err
|
||||
} else {
|
||||
a.InvalidateCacheForWebhook(oldHook.Id)
|
||||
return result.Data.(*model.IncomingWebhook), nil
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user