MM-32652 /threads?unread=true returns null threads and no counts if there are no unread threads (#16885)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
Eli Yukelzon
2021-02-15 15:42:05 +02:00
committed by GitHub
co-authored by Mattermod
parent a3de71fba4
commit 830594004b
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -5429,6 +5429,14 @@ func TestGetThreadsForUser(t *testing.T) {
require.Equal(t, uss2.Threads[0].PostId, rootIdAfter)
uss3, resp3 := th.Client.GetUserThreads(th.BasicUser.Id, th.BasicTeam.Id, model.GetUserThreadsOpts{
Deleted: false,
PageSize: 10,
After: rootId + "__bad",
})
require.Nil(t, resp3.Error)
require.NotNil(t, uss3.Threads)
require.Len(t, uss3.Threads, 0)
})
}
+1 -1
View File
@@ -301,7 +301,7 @@ func (s *SqlThreadStore) GetThreadsForUser(userId, teamId string, opts model.Get
result := &model.Threads{
Total: totalCount,
Threads: nil,
Threads: []*model.ThreadResponse{},
TotalUnreadMentions: totalUnreadMentions,
TotalUnreadThreads: totalUnreadThreads,
}