MM-48614: saves priority for drafts (#21752)

* MM-48614: saves priority for drafts

Adds a new column in the drafts table, "priority".
This way we can save post's priority in the draft.

Fixes OmitConnectionId, which when you published a ws event for a user
was getting bypassed.

Fixes Get for drafts returns deleted ones as well, which is needed for
upsert.

* Adds test case for the OmitConnectionId

* Addresses review comments, removes DeleteAt

* Vets

* Adds missing translation

* Re-instates DeleteAt column

* Adds separate case to get draft including deleted

* Fixes Update Draft

* Empty
Этот коммит содержится в:
Kyriakos Z
2022-11-29 23:36:47 +02:00
коммит произвёл GitHub
родитель 4f3f6e6496
Коммит a240cd53eb
22 изменённых файлов: 453 добавлений и 387 удалений

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

@@ -2996,10 +2996,10 @@ func (s *TimerLayerDraftStore) Delete(userID string, channelID string, rootID st
return err
}
func (s *TimerLayerDraftStore) Get(userID string, channelID string, rootID string) (*model.Draft, error) {
func (s *TimerLayerDraftStore) Get(userID string, channelID string, rootID string, includeDeleted bool) (*model.Draft, error) {
start := time.Now()
result, err := s.DraftStore.Get(userID, channelID, rootID)
result, err := s.DraftStore.Get(userID, channelID, rootID, includeDeleted)
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {