MM-57326: [Shared Channels] Message priority, acknowledgement and persistent notifications need to be synced (#30736)

Этот коммит содержится в:
catalintomai
2025-06-16 02:30:21 +02:00
коммит произвёл GitHub
родитель fa1c77d9b0
Коммит 85391de22a
27 изменённых файлов: 2667 добавлений и 101 удалений

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

@@ -773,9 +773,14 @@ func (a *App) UpdatePost(c request.CTX, receivedUpdatedPost *model.Post, updateP
if newPost == nil {
return nil, model.NewAppError("UpdatePost", "Post rejected by plugin. "+rejectionReason, nil, "", http.StatusBadRequest)
}
// Restore the post metadata that was stripped by the plugin. Set it to
// the last known good.
newPost.Metadata = oldPost.Metadata
// Always use incoming metadata when provided, otherwise retain existing
if receivedUpdatedPost.Metadata != nil {
newPost.Metadata = receivedUpdatedPost.Metadata.Copy()
} else {
// Restore the post metadata that was stripped by the plugin. Set it to
// the last known good.
newPost.Metadata = oldPost.Metadata
}
rpost, nErr := a.Srv().Store().Post().Update(c, newPost, oldPost)
if nErr != nil {