Migrate loginList to logins Onyx key with expensifyLoginsSelector#91616
Conversation
- Add CONST.PARTNER_ID.EXPENSIFY (1) constant
- Create expensifyLoginsSelector in UserUtils.ts that filters LOGINS by
partnerID === 1 and returns data in the old LoginList shape
- Migrate all useOnyx(ONYXKEYS.LOGIN_LIST) call sites to use
useOnyx(ONYXKEYS.LOGINS, {selector: expensifyLoginsSelector})
- Migrate write operations in User.ts to write to ONYXKEYS.LOGINS with
{partnerID}_{partnerUserID} key format
- Update Logins.ts type to support contact method optimistic fields
- Remove ONYXKEYS.LOGIN_LIST key and type mapping
- Update all tests to use new key format
Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com>
|
@eVoloshchak can you progress this today, please? Thanks! |
|
The code looks good and this is working on all of the platforms (there are no user-facing changes, this is a technical improvement). This already supports |
Those backend changes are live now |
|
@eVoloshchak can you fix up this PR and have it in review today? Thanks! |
|
@MelvinBot, pull the latest main |
…stToLoginsSelector Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com> # Conflicts: # src/pages/home/TimeSensitiveSection/index.tsx # src/pages/settings/Profile/ProfilePage.tsx # src/pages/workspace/expensifyCard/WorkspaceExpensifyCardFeedSelectorPage.tsx
|
🤖 Merged the latest There were 3 import/declaration conflicts, all resolved by keeping both sides:
Verified with |
The Settings-tab "Has GBR" test set partnerUserID equal to the primary session email, so hasLoginListInfo no longer detected an unvalidated secondary contact method and the info indicator (and DebugTabView) never rendered. Use a distinct secondary login to restore the info-indicator condition, matching the pre-migration test intent. Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com>
|
Fixed the failing check What failed: Root cause: The green-brick-road (info) indicator only appears for an unvalidated secondary contact method — i.e. a login whose Fix: Restore the secondary-login semantics in that one test by using a distinct unvalidated login ( Why this was a test-only issue (source path is correct)
|
- Add partnerID to addNewContactMethod optimistic data so expensifyLoginsSelector keeps the optimistic login - Mock Navigation.getActiveRoute in ContactMethodDetailsPage test so the not-found render path does not crash Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com>
|
🤖 Pushed a fix for the failing Root causeAll three failing tests were a side effect of migrating from 1 & 2 — 3 — Verification
The remaining |
|
I analyzed the failing checks — there's no code fix to push. All 26 code/CI checks pass (typecheck, ESLint, Prettier, all 8 1. This comes from 2. Once the CLA job is re-run and the checklist is completed, the PR will be green. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
I analyzed the two failing checks. Neither is caused by this PR's code — there's nothing to fix in the diff. 1. All 4 commits are authored by 2. Everything else is green — typecheck, ESLint, Prettier, all 8 test shards, Storybook, all builds, and the perf comparison all pass. |
|
@MelvinBot, propose some test steps so the QA can test this |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppvideo_2026-06-02_19-54-16.mp4Android: mWeb ChromeScreen.Recording.2026-06-02.at.19.19.37.moviOS: HybridAppScreen.Recording.2026-06-02.at.19.16.33.moviOS: mWeb SafariScreen.Recording.2026-06-02.at.19.13.02.movMacOS: Chrome / SafariScreen.Recording.2026-06-02.at.09.39.27.mov |
|
This PR is a pure Onyx key migration ( QA Steps1. View contact methods
2. Add a new contact method + magic-code validation
3. Set default contact method
4. Remove a contact method
5. Account indicator dots (these read login data via
6. Participant / search selectors (read login data)
7. Work-email verification (company / Expensify Card)
8. Onboarding (fresh signup only)
9. Offline behavior
10. Console
Since behavior is meant to be identical to production, the pass criterion for each step is simply: it works exactly as it does on production today. 🤖 Generated by MelvinBot. Reply with |
|
@MelvinBot, there is a bug present:
|
|
I couldn't reproduce this on the PR branch, and the migrated code doesn't sit on the group-name code path — so I don't think this PR causes it. Evidence below. Reproduction attempt (this branch): FAB → Start chat → selected two participants → Next → Start group. The group name rendered correctly in the report header and in Search — no loading skeleton, no empty name, and no related console errors.
Why this PR is an unlikely cause: the group name is computed from the participants' display names, not from login data.
An empty group title would instead mean every participant's To help me pin it down, could you confirm:
🤖 Generated by MelvinBot. Reply with |
|
@MelvinBot, pull the latest main |
…stToLoginsSelector Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com>
|
🤖 Merged the latest
Note: CI will re-run on the new commit. Please re-verify the test/QA steps still pass against the updated base before marking ready for review. |
|
MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR. Next steps: A human should review the recent commits and resolve the conflicting CI errors manually. |
|
Re-testing |
|
@MelvinBot, pull the latest main |
|
⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai. |
|
@MelvinBot, pull the latest main |
…stToLoginsSelector Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com> # Conflicts: # src/libs/UserUtils.ts # src/libs/actions/User.ts # src/pages/workspace/expensifyCard/WorkspaceExpensifyCardFeedSelectorPage.tsx
|
@arosiclair 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] |
|
🤖 Merged the latest There were 3 conflicts, all clean additive overlaps that I resolved by keeping both sides:
Prettier reported no formatting changes. Please re-run CI / verify the checks pass. |
Stop clearing partnerUserID in deleteContactMethod so the optimistic
pending-delete row keeps its identity under the 1_${contactMethod} key.
The pending state is carried by pendingFields.deletedLogin.
- Remove the || loginName fallback in getContactMethodsOptions
- Detect pending-delete via pendingFields.deletedLogin in ContactMethodDetailsPage
guards that previously relied on the cleared partnerUserID
Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com>
|
@eVoloshchak is this ready? The author checklist, test steps, and etc still need to be filled out. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppvideo_2026-06-09_08-58-25.mp4Android: mWeb ChromeScreen.Recording.2026-06-09.at.11.36.23.moviOS: HybridAppScreen.Recording.2026-06-09.at.08.26.06.moviOS: mWeb SafariScreen.Recording.2026-06-09.at.08.43.09.movMacOS: Chrome / SafariScreen.Recording.2026-06-09.at.08.17.45.mov |
|
@MelvinBot, fill out the tests section in PR author checklist with those steps and |
|
🚧 @arosiclair has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 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.2-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 I reviewed the changes in this PR against the help site articles under No help site changes are required. This PR is a purely internal refactor: it migrates all consumers of the legacy Specifically, the diff contains:
There are no changes to user-facing copy ( If you believe a specific article needs updating, let me know which behavior changed and I'll take another look. |
|
Deploy Blocker #93134 was identified to be related to this PR. |
|
@trjExpensify @eVoloshchak @arosiclair Could you please confirm how should we check Test 7? We have no
|
|
@arosiclair @eVoloshchak When offline, the Add button is disabled, preventing us from adding a contact. Could you please confirm whether this is expected behavior or a potential issue? |
@m-natarajan if that's the case, we can just skip the offline test steps listed here. Not an issue. |
|
@arosiclair @eVoloshchak This PR is failing because of a regression issue #90691 |
|
🚀 Deployed to staging by https://github.com/arosiclair in version: 9.4.4-1 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required. I reviewed the changes in this PR against the help articles under Why no docs changes are requiredWhat the PR does: Migrates all consumers of the legacy Why it doesn't affect the help site:
Help articles document user-facing product behavior. Since this refactor changes only how login data is stored and read internally — not what the user sees or does — the existing articles remain accurate. @eVoloshchak, 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/Julesssss in version: 9.4.4-3 🚀
|






Explanation of Change
Migrates all consumers of the legacy
loginListOnyx key to read from the newloginskey via anexpensifyLoginsSelector. The newloginskey stores all logins across all partners in a dictionary keyed by{partnerID}_{partnerUserID}. The selector filters to Expensify logins (partnerID === 1) and re-keys bypartnerUserID, returning the sameLoginListshape so downstream code changes are minimal.Key changes:
CONST.PARTNER_ID.EXPENSIFY = 1expensifyLoginsSelectorinUserUtils.tsthat filtersLOGINSentries by partnerID and returnsLoginList-compatible shapeuseOnyx(ONYXKEYS.LOGIN_LIST)call sites touseOnyx(ONYXKEYS.LOGINS, {selector: expensifyLoginsSelector})User.tsto write toONYXKEYS.LOGINSwith{partnerID}_{partnerUserID}key formatLogintype inLogins.tswithvalidateCodeSentand contact method error/pending field keysLOGIN_LISTOnyx key definition and type mappingFixed Issues
$ #91018
PROPOSAL: #91018 (comment)
Tests
1. View contact methods
2. Add a new contact method + magic-code validation
3. Set default contact method
4. Remove a contact method
5. Account indicator dots (these read login data via
useAccountIndicatorChecks)6. Participant / search selectors (read login data)
7. Work-email verification (company / Expensify Card)
8. Onboarding (fresh signup only)
Offline tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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