[BTAPI-50] Fix transaction ordering: _id descending tiebreaker #58

Merged
chris merged 3 commits from feature/BTAPI-50 into main 2026-07-01 21:14:30 -06:00
Owner

Ticket

BTAPI-50 Fix transaction ordering: same-timestamp transactions appear in wrong order

Summary

  • Change getForWeek sort from { date: -1, _id: 1 } to { date: -1, _id: -1 } so same-timestamp transactions are ordered most-recently-inserted first
  • Add matching _id descending tiebreaker to the app client-side sort so display order stays consistent with the server after optimistic updates
  • Update all affected tests: tiebreaker test in transaction data layer, split-pair order test in budget router, stability test in the transactions screen
## Ticket [BTAPI-50](http://192.168.2.100:7123/home/browse/BTAPI-50/) Fix transaction ordering: same-timestamp transactions appear in wrong order ## Summary - Change `getForWeek` sort from `{ date: -1, _id: 1 }` to `{ date: -1, _id: -1 }` so same-timestamp transactions are ordered most-recently-inserted first - Add matching `_id` descending tiebreaker to the app client-side sort so display order stays consistent with the server after optimistic updates - Update all affected tests: tiebreaker test in transaction data layer, split-pair order test in budget router, stability test in the transactions screen
[BTAPI-50] Address pre-PR review.
All checks were successful
app / check (pull_request) Successful in 22s
server / check (pull_request) Successful in 21s
plane-sync / sync (pull_request) Successful in 2s
290468a799
chris merged commit 9b0a146468 into main 2026-07-01 21:14:30 -06:00
chris deleted branch feature/BTAPI-50 2026-07-01 21:14:30 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
chris/budget-tracker!58
No description provided.