From 58630047277344f4bbaf20e74747a4dfc5804536 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Mon, 3 Aug 2026 19:21:19 +0200 Subject: [PATCH] Fix: Keyset-Pagination use_keyset unabhaengig von cursor (erste Seite ohne cursor) --- app/services/contact_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/contact_service.py b/app/services/contact_service.py index a2dc0c5..8eecf14 100644 --- a/app/services/contact_service.py +++ b/app/services/contact_service.py @@ -182,9 +182,9 @@ async def list_contacts( Contact.search_tsv.op("@@")(func.plainto_tsquery("german", search)) ) - # Keyset-Pagination: filter by cursor if provided - use_keyset = cursor is not None and sort_by == "id" and sort_order == "asc" - if use_keyset: + # Keyset-Pagination: use keyset when sorting by id (independent of cursor) + use_keyset = sort_by == "id" and sort_order == "asc" + if use_keyset and cursor is not None: base = base.where(Contact.id > uuid.UUID(cursor)) # Count