Add a stable tiebreaker to the todo list order
What is wrong
src/features/todos/todos.repository.ts orders the list by one field only ({ [sortBy]: order }). With sortBy=completed or title many rows share a value, so PostgreSQL may return them in a different order on each query, and offset pages (skip/take) can repeat or skip todos.
Why it matters
Clients paging through a sorted list can see duplicates or miss items.
Definition of done
orderBygets a unique tiebreaker, e.g.[{ [sortBy]: order }, { id: 'asc' }].todos.repository.spec.tsis updated for both orderBy cases;npx jest src/features/todospasses.guide/performance.md("Pagination semantics") mentions the tiebreaker. No migration is needed; note in the PR how it relates to the pending indexes in #19.
Pointers
Performance, section "Use Pagination for Collections".
Hi @AlexSergey! If it's still free, I'd like to take this one too. Plan: add { id: 'asc' } as a tiebreaker after the sort field, update both orderBy cases in todos.repository.spec.ts, and mention it in the "Pagination semantics" section of `guide/performance.md".
@devmaiter , thanks, it's yours! One addition from the definition of done: in the PR description, please note how the id tiebreaker relates to the pending indexes in #19 (no migration is needed here). npx jest src/features/todos should pass.