Repository navigation
[Internal QA] [Payment due @daledah] Fix company card export account selector crash on duplicate account names - #101907
Conversation
QuickBooks Desktop and QuickBooks Online built their export account rows with keyForList set to the account display name. QBD lets two credit card accounts share a name under different parents, so the rows collided on one key, FlashList re-rendered without committing, and React bailed out with 'Maximum update depth exceeded' — the account selector showed 'Something went wrong' and the export account could never be changed. Account ids are unique, so key every integration's rows by id.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f91c81b92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
tests/README.md asks every test case to carry Given, When and Then comments that explain why the test is shaped the way it is.
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2026-09-23.at.14.21.01.mov |
|
@MonilBhavsar 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] |
|
🎯 @daledah, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
|
👍 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 MonilBhavsar 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/MonilBhavsar in version: 9.4.93-0 🚀
|
|
No help site changes are required, so I did not create a docs PR. This PR changes an internal React list key only. In What I checkedI searched
No article documents the duplicate-name symptom, and none carries a workaround that this fix would make obsolete. There is nothing to add, remove, or correct. One pre-existing gap, unrelated to this PR: the New Expensify article @NicolasBonet, I did not create a help site PR because nothing on the help site needs to change. If you think a specific article should cover this flow, tell me which one and I'll draft it. |
|
Hi @NicolasBonet. QA team got this error on the first attempt on the Expensify side
For the second attempt, the remote terminal froze for us unstable.QBD.terminal-2.mp4Is it possible to check it internally as we faced with froze issue? |
|
This can be handled internally @IuliiaHerets |
|
🤖 Payment issue created: #102289 |
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.4.93-3 🚀
Bundle Size Analysis (Sentry): |

Explanation of Change
QBD and QBO built their export account rows with
keyForListset to the account display name. QBD routinely exposes two credit card accounts with the same name under different parents, so two rows collide on one key.What that costs depends on the list length. On a short list the second row is silently dropped — the selector shows one entry plus an empty gap where the other should be, and that account can never be chosen. Once the list is long enough to virtualise, FlashList reports
Exceeded max renders without commit, the list re-renders without committing, and React bails out with error #185, which paints "Something went wrong". Either way nothing reaches the server; the card's export account is simply unchangeable.Every other integration already keys by
id, andkeyForListis only the list key — selection resolves byid— so keying QBD and QBO byidtoo is a drop-in fix.shouldKeyByLabelhad no other callers and is removed. The QBDshouldFallBackToLabelMatchNVP behaviour is unrelated and stays.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/680784
PROPOSAL: N/A (internal)
Tests
Everything the selector renders comes from Onyx —
usePolicy(policyID)anduseCardsList(feed)— so a QuickBooks Desktop Web Connector and a real card feed are not needed. Dev builds exposewindow.Onyx(src/setup/addUtilsToWindow.ts).policyIDfrom the URL.<feedName>#<domainID>, and the Onyx key iscards_<domainID>_<feedName>:/workspaces/<POLICYID>/company-cards/company-card-details/oauth.chase.com%231/1. Verify the card details page renders with an Accounting section reading "QuickBooks Desktop credit card export — Corporate Card".Default card, and bothCorporate Cardentries, with the card's own account (80000106-2) check-marked. Onmainonly oneCorporate Cardrow renders and an empty gap sits where the other should be, so the second account cannot be selected at all.Corporate Cardrow that is not currently selected, and verify the card details page updates to it. Onmainthere is no second row to select.quickbooksOnline,creditCardsfor the credit card export andbankAccountsfor the debit card export) and verify both same-named accounts appear and are selectable.Exceeded max renders without commitor React error Add link styles for sidebar footer #185. Neither should appear. On a list long enough to virtualise, the duplicate keys produce those warnings and the "Something went wrong" error screen instead of the silently dropped row.Offline tests
QA Steps
Needs a QuickBooks Desktop workspace whose chart of accounts contains two credit card accounts with the same display name (QBD allows this when they sit under different parents), and a company card on that workspace.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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
MacOS: Chrome / Safari
Two QuickBooks Desktop credit card accounts share the display name "Corporate Card".
Before — only one
Corporate Cardrow renders, with an empty gap where the other should be, so that account cannot be selected:After — both accounts render, and the one the card's NVP points at is check-marked: