Sort Recently added expenses by snapshot's "inserted" field only#95379
Conversation
|
It looks like some tests need to be adjusted |
|
Beside tests, it looks good to me |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-07-07.17.49.51.movAndroid: mWeb Chrome2026-07-07.17.47.53.moviOS: HybridApp2026-07-07.17.49.51.moviOS: mWeb Safari2026-07-07.17.47.53.movMacOS: Chrome / Safari2026-07-07.17.46.12.mov |
|
@situchan |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/grgia in version: 9.4.33-0 🚀
|
|
🤖 No help site changes required. This PR is a purely internal refactor of the sort logic in the Home Recently added section — it drops the local- The existing help article
That description remains correct after this change (the removed |
Explanation of Change
Makes the sorting of expenses in Recently added section in Home only based on the
insertedfield from the Search snapshot (or from transaction for local-only ones). And if the timestamps are equal, which is unlikely, the fallback is to sort by transactionID to guarantee stability. Previously the backend did not sendinsertedin the snapshot, so we based it on the local Transaction Onyx collection and on thecreateddate which led to inconsistent sorting when data is not fully loaded. The backend data being sent fixed the issue on its own, but this PR takes the opportunity to simplify the code, improve performance and guarantee sort stability.Fixed Issues
$ #94237
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-07-6.o.15.37.32.mov