From 39e16653aaa4aebcef76d11002b3b832c68bb7d2 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 26 Mar 2026 16:31:27 +0100 Subject: [PATCH] fix: add ORDER BY to ListUsers query for deterministic ordering The query had no ORDER BY clause, causing non-deterministic result ordering on PostgreSQL where row order is not guaranteed. --- pkg/user/users_project.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/user/users_project.go b/pkg/user/users_project.go index 1ac92dfb5..4ce88ed49 100644 --- a/pkg/user/users_project.go +++ b/pkg/user/users_project.go @@ -149,6 +149,7 @@ func ListUsers(s *xorm.Session, search string, currentUser *User, opts *ProjectU err = s. Where(cond). + OrderBy("id"). Find(&users) outer: