Sort Device Management devices list by most recent timestamp first#95316
Conversation
Co-authored-by: cretadn22 <cretadn22@users.noreply.github.com>
Co-authored-by: cretadn22 <cretadn22@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
🤖 I looked into the failing checks. No code fix is needed — nothing is actually broken by this PR. The only failing check is To clear it,
Everything else is green — all 28 automated code checks pass:
The two Bottom line: there's nothing to push — the red X is the human checklist, not a code failure. |
|
@MelvinBot Mark this PR ready |
|
@cretadn22 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🤖 Done — this PR is now marked Ready for review. One heads-up before reviewers dig in: the |
Reviewer Checklist
Screenshots/Videos |
|
🤖 Re-checked — all 35 automated code checks are now green (the perf-test checks that were still running earlier all passed). There's still nothing to push. The single remaining ❌ is To turn everything green,
|
|
🤖 Re-checked — all automated checks are now green (the two Reassure The single remaining red ❌ is To turn it green,
There's no code failure here, so there's nothing for me to fix or push. |
|
🤖 Re-checked — still no code fix to push. Every automated check is now green (the two Reassure The one red X is To turn it green,
Nothing in the code is failing, so there's nothing for me to commit. |
|
🚧 arosiclair has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/arosiclair in version: 9.4.28-0 🚀
|
|
🤖 Reviewed the changes and yes, a small help site update is warranted. This PR sorts the Device management list so the most recently used/added device appears first ( Draft help site PR: #95411 @cretadn22, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.4.28-2 🚀
Bundle Size Analysis (Sentry): |





Explanation of Change
The Device Management screen was rendering devices in an arbitrary order because
getDeviceLoginsreturnedObject.values(logins).filter(...)without any sort, so the list reflected object key order rather than recency.This change sorts the filtered device logins descending by
getLastLogin— the same timestamp already displayed in each row (which is the later oflastLogin/created, so it handles the default2008-01-01lastLoginfallback) — so the most recently used/added device appears first. Sorting lives in thegetDeviceLoginsselector, keeping the sort out of the render path and reused by every consumer.lastLogin/createdare ISO datetime strings, so a plain lexicographic comparison sorts them chronologically (and avoids theprefer-locale-compare-from-contextrule, since a util cannot use theuseLocalizehook).Fixed Issues
$ #95307
PROPOSAL: #95307 (comment)
Tests
Offline tests
Same as tests.
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.🤖 Automated AI checks run locally on the changed files (
src/libs/UserUtils.ts,tests/unit/UserUtilsTest.ts):npm run fmt(oxfmt) — ✅ cleannpm run lint-changed(eslint) — ✅ cleannpm run typecheck-tsgo— ✅ cleannpm test tests/unit/UserUtilsTest.ts— ✅ 11 passed (includes 3 newgetDeviceLoginssort tests)