From 8703933df4e3c4c0c778c4953b1f013d6811aa31 Mon Sep 17 00:00:00 2001 From: Christoph Voigt Date: Tue, 13 Dec 2022 12:33:49 +0100 Subject: [bugfix] fix unordered favorites (#1245) * [bugfix] fix unordered favorites * add test for favouritesget * add license to new test files --- internal/db/bundb/timeline.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/db') diff --git a/internal/db/bundb/timeline.go b/internal/db/bundb/timeline.go index b52b68459..5ebfd6f76 100644 --- a/internal/db/bundb/timeline.go +++ b/internal/db/bundb/timeline.go @@ -233,7 +233,7 @@ func (t *timelineDB) GetFavedTimeline(ctx context.Context, accountID string, max // Sort by favourite ID rather than status ID slices.SortFunc(faves, func(a, b *gtsmodel.StatusFave) bool { - return b.CreatedAt.Before(a.CreatedAt) + return a.ID > b.ID }) statuses := make([]*gtsmodel.Status, 0, len(faves)) -- cgit v1.3