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 ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
09c0eb7e7a
Коммит
6f3327ce0f
@@ -52,7 +52,7 @@ func testSaveAcknowledgementForPost(t *testing.T) {
|
||||
_, err = th.App.SaveAcknowledgementForPost(th.Context, post.Id, th.BasicUser.Id)
|
||||
require.Nil(t, err)
|
||||
|
||||
post, err = th.App.GetSinglePost(post.Id, false)
|
||||
post, err = th.App.GetSinglePost(th.Context, post.Id, false)
|
||||
require.Nil(t, err)
|
||||
|
||||
require.Greater(t, post.UpdateAt, oldUpdateAt)
|
||||
@@ -91,7 +91,7 @@ func testDeleteAcknowledgementForPost(t *testing.T) {
|
||||
_, err := th.App.SaveAcknowledgementForPost(th.Context, post.Id, th.BasicUser.Id)
|
||||
require.Nil(t, err)
|
||||
|
||||
post, err = th.App.GetSinglePost(post.Id, false)
|
||||
post, err = th.App.GetSinglePost(th.Context, post.Id, false)
|
||||
require.Nil(t, err)
|
||||
|
||||
oldUpdateAt := post.UpdateAt
|
||||
@@ -99,7 +99,7 @@ func testDeleteAcknowledgementForPost(t *testing.T) {
|
||||
err = th.App.DeleteAcknowledgementForPost(th.Context, post.Id, th.BasicUser.Id)
|
||||
require.Nil(t, err)
|
||||
|
||||
post, err = th.App.GetSinglePost(post.Id, false)
|
||||
post, err = th.App.GetSinglePost(th.Context, post.Id, false)
|
||||
require.Nil(t, err)
|
||||
|
||||
require.Greater(t, post.UpdateAt, oldUpdateAt)
|
||||
|
||||
Ссылка в новой задаче
Block a user