[GH-25484] Fix draft removal on post deletion (#25715)

* [GH-25484] Fix draft removal on post deletion

* [GH-25484] Add batch migration to remove orphan drafts

* [GH-25484] Fix tests of migration and draft store

* [GH-25484] Remove translation file changes.

* [GH-25484] Remove translation file changes.

---------

Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
Этот коммит содержится в:
Utsav Ladani
2024-01-29 20:25:34 +05:30
коммит произвёл GitHub
родитель 435da9bea7
Коммит 3ac6edb406
19 изменённых файлов: 1046 добавлений и 15 удалений

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

@@ -28,6 +28,20 @@ func (_m *DraftStore) Delete(userID string, channelID string, rootID string) err
return r0
}
// DeleteDraftsAssociatedWithPost provides a mock function with given fields: channelID, rootID
func (_m *DraftStore) DeleteDraftsAssociatedWithPost(channelID string, rootID string) error {
ret := _m.Called(channelID, rootID)
var r0 error
if rf, ok := ret.Get(0).(func(string, string) error); ok {
r0 = rf(channelID, rootID)
} else {
r0 = ret.Error(0)
}
return r0
}
// DeleteEmptyDraftsByCreateAtAndUserId provides a mock function with given fields: createAt, userId
func (_m *DraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userId string) error {
ret := _m.Called(createAt, userId)
@@ -42,6 +56,20 @@ func (_m *DraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userI
return r0
}
// DeleteOrphanDraftsByCreateAtAndUserId provides a mock function with given fields: createAt, userId
func (_m *DraftStore) DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, userId string) error {
ret := _m.Called(createAt, userId)
var r0 error
if rf, ok := ret.Get(0).(func(int64, string) error); ok {
r0 = rf(createAt, userId)
} else {
r0 = ret.Error(0)
}
return r0
}
// Get provides a mock function with given fields: userID, channelID, rootID, includeDeleted
func (_m *DraftStore) Get(userID string, channelID string, rootID string, includeDeleted bool) (*model.Draft, error) {
ret := _m.Called(userID, channelID, rootID, includeDeleted)