MM-58038: Use context to call master for DeletePost (#27098)

Calling app.DeletePost immediately after creating a post
is susceptible to replica lag because we were calling the
replica to check for the post.

We fix this by passing a context to always query master.

https://mattermost.atlassian.net/browse/MM-58038

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2024-05-24 19:35:48 +05:30
коммит произвёл GitHub
родитель 09c0eb7e7a
Коммит 6f3327ce0f
34 изменённых файлов: 94 добавлений и 93 удалений

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

@@ -15,7 +15,7 @@ import (
)
func (a *App) SaveReactionForPost(c request.CTX, reaction *model.Reaction) (*model.Reaction, *model.AppError) {
post, err := a.GetSinglePost(reaction.PostId, false)
post, err := a.GetSinglePost(c, reaction.PostId, false)
if err != nil {
return nil, err
}
@@ -132,7 +132,7 @@ func populateEmptyReactions(postIDs []string, reactions map[string][]*model.Reac
}
func (a *App) DeleteReactionForPost(c request.CTX, reaction *model.Reaction) *model.AppError {
post, err := a.GetSinglePost(reaction.PostId, false)
post, err := a.GetSinglePost(c, reaction.PostId, false)
if err != nil {
return err
}