MM-49564: Drafts upsert in the Store vs App layer (#22530)
* MM-49564: Upsert in the Store vs App layer Refactor drafts so that Upserting a draft would happen in the DB and not in the app layer. * Fixes mocks * Fixes tests * Fixes translations * Fixes tests * Update tests * Fixes tests * Addresses review comments - renames Save => Upsert - removes Sleep from tests * Fixes flaky test --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -65,16 +65,3 @@ func TestDraftPreSave(t *testing.T) {
|
||||
|
||||
assert.LessOrEqual(t, o.CreateAt, past)
|
||||
}
|
||||
|
||||
func TestDraftPreUpdate(t *testing.T) {
|
||||
o := Draft{Message: "test"}
|
||||
o.PreUpdate()
|
||||
|
||||
assert.NotEqual(t, 0, o.UpdateAt)
|
||||
|
||||
past := GetMillis() - 1
|
||||
o = Draft{Message: "test", UpdateAt: past}
|
||||
o.PreSave()
|
||||
|
||||
assert.GreaterOrEqual(t, o.UpdateAt, past)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user