From 45ae263ab978952253b40a799d2ce2fb50042ebd Mon Sep 17 00:00:00 2001 From: devlikepro Date: Thu, 26 Feb 2026 10:08:44 +0700 Subject: [PATCH] [core] NOWEB - fix ordering - timestamp first --- src/core/engines/noweb/store/sql/SqlChatMethods.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/engines/noweb/store/sql/SqlChatMethods.ts b/src/core/engines/noweb/store/sql/SqlChatMethods.ts index 7c5bf3e2..4e4cbd43 100644 --- a/src/core/engines/noweb/store/sql/SqlChatMethods.ts +++ b/src/core/engines/noweb/store/sql/SqlChatMethods.ts @@ -31,7 +31,7 @@ export class SqlChatMethods { .select( 'annotated_chats.*', knex.raw( - 'ROW_NUMBER() OVER (PARTITION BY annotated_chats.primary_jid ORDER BY annotated_chats.primary_priority ASC, annotated_chats."conversationTimestamp" DESC) as __rownum', + 'ROW_NUMBER() OVER (PARTITION BY annotated_chats.primary_jid ORDER BY annotated_chats."conversationTimestamp" DESC, annotated_chats.primary_priority ASC) as __rownum', ), ) .from(annotatedQuery)