fix(data): append id tiebreaker to paged message ORDER BY (pagination correctness) #311

Closed
opened 2026-07-04 06:52:47 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-07-04 06:52:47 +00:00 (Migrated from github.com)

Phase-3 review (LOW/correctness, trivial). The four PagingSource queries in MessageDao(:43,59,79,94) ORDER BY timestampMillis DESC with no unique tiebreaker; timestampMillis isn't unique (bulk mail shares a second) so tied rows at a LIMIT/OFFSET page boundary can duplicate/skip. Fix (free): ORDER BY timestampMillis DESC, id (id is PK; no new index).

Phase-3 review (LOW/correctness, trivial). The four `PagingSource` queries in `MessageDao`(:43,59,79,94) `ORDER BY timestampMillis DESC` with no unique tiebreaker; timestampMillis isn't unique (bulk mail shares a second) so tied rows at a LIMIT/OFFSET page boundary can duplicate/skip. **Fix (free):** `ORDER BY timestampMillis DESC, id` (id is PK; no new index).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMail#311