From 5392ca788cef365a6625d1f69e345f2e1b815e84 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 29 Aug 2023 14:09:53 +0200 Subject: [PATCH] fix(comments): make sure comment sort order is stable Resolves https://community.vikunja.io/t/comment-order-is-not-by-time/1147/3?u=kolaente --- pkg/models/task_comments.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/models/task_comments.go b/pkg/models/task_comments.go index 7d099047f..429a0a8a1 100644 --- a/pkg/models/task_comments.go +++ b/pkg/models/task_comments.go @@ -243,7 +243,8 @@ func (tc *TaskComment) ReadAll(s *xorm.Session, auth web.Auth, search string, pa builder.Eq{"task_id": tc.TaskID}, db.ILIKE("comment", search), )). - Join("LEFT", "users", "users.id = task_comments.author_id") + Join("LEFT", "users", "users.id = task_comments.author_id"). + OrderBy("id", "asc") if limit > 0 { query = query.Limit(limit, start) }