diff --git a/server/channels/store/sqlstore/channel_bookmark_store.go b/server/channels/store/sqlstore/channel_bookmark_store.go index 47c9126871..f0a7a5baa7 100644 --- a/server/channels/store/sqlstore/channel_bookmark_store.go +++ b/server/channels/store/sqlstore/channel_bookmark_store.go @@ -317,7 +317,6 @@ func (s *SqlChannelBookmarkStore) Delete(bookmarkId string, deleteFile bool) err From("ChannelBookmarks"). Where(sq.And{ sq.Eq{"Id": bookmarkId}, - sq.Eq{"DeleteAt": 0}, }) fileQuery, fileArgs, fileErr := s.getQueryBuilder(). diff --git a/server/channels/store/storetest/channel_bookmark.go b/server/channels/store/storetest/channel_bookmark.go index 03e35a2007..221e74e61a 100644 --- a/server/channels/store/storetest/channel_bookmark.go +++ b/server/channels/store/storetest/channel_bookmark.go @@ -434,6 +434,11 @@ func testDeleteChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) { err = ss.ChannelBookmark().Delete(bookmark2.Id, true) assert.NoError(t, err) + _, err = ss.FileInfo().Get(file.Id) + assert.Error(t, err) + var nfErr *store.ErrNotFound + assert.ErrorAs(t, err, &nfErr) + bookmarks, err := ss.ChannelBookmark().GetBookmarksForChannelSince(channelId, now) assert.NoError(t, err) assert.Len(t, bookmarks, 2) // we have two as the deleted record also gets returned for sync'ing purposes