Use getCardSettings for nested paymentBankAccountID in card reconciliation#85290
Use getCardSettings for nested paymentBankAccountID in card reconciliation#85290carlosmiceli merged 3 commits intomainfrom
Conversation
…conciliation The isExpensifyCardFullySetUp function and CardReconciliationPage both read paymentBankAccountID directly from the root level of card settings. When the backend sends Phase 2 nested format (paymentBankAccountID inside US/CURRENT/GB sub-objects), the root-level check fails, hiding the card reconciliation option and showing "Hmm... it's not here" on the page. Update isExpensifyCardFullySetUp to use getCardSettings() helper which correctly resolves nested settings. Similarly update CardReconciliationPage to use getCardSettings() when reading paymentBankAccountID. Co-authored-by: Cong Pham <suneox@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. |
|
The failing check is unrelated to this PR. Analysis: The only failure is in Evidence: This PR only modifies |
|
@MelvinBot The current PR is missing the implementation for the data-not-loaded case mentioned in the proposal. |
When navigating directly to the Accounting page without first visiting the Expensify Card page, PRIVATE_EXPENSIFY_CARD_SETTINGS may not be loaded in Onyx. This adds a useEffect that calls openPolicyExpensifyCardsPage to ensure card settings are fetched, so shouldShowCardReconciliationOption evaluates correctly. Co-authored-by: Cong Pham <suneox@users.noreply.github.com>
|
Added the missing data-not-loaded fix from the proposal. What was missing: When a user navigates directly to the Accounting page without first visiting the Expensify Card page, What was added: A Changes in
|
Co-authored-by: Cong Pham <suneox@users.noreply.github.com>
|
Fixed the failing Prettier check: moved the |
|
@MelvinBot change PR status it ready for review |
|
I'm unable to change the PR from draft to ready for review due to permission restrictions on this GitHub token. You can mark it as ready for review yourself by clicking "Ready for review" at the bottom of the PR page, or by running: |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppCleanShot.2026-03-14.at.14.22.54.mp4Android: mWeb ChromeCleanShot.2026-03-14.at.14.22.54.mp4iOS: HybridAppCleanShot.2026-03-14.at.13.50.51.mp4iOS: mWeb SafariCleanShot.2026-03-14.at.13.55.08.mp4MacOS: Chrome / SafariCleanShot.2026-03-14.at.13.47.54.mp4 |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot ready for review |
|
PR has been marked as ready for review. |
|
@carlosmiceli 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74929b2367
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (!policyID || !policy?.areExpensifyCardsEnabled || !workspaceAccountID) { | ||
| return; | ||
| } | ||
| openPolicyExpensifyCardsPage(policyID, workspaceAccountID); | ||
| }, [policyID, policy?.areExpensifyCardsEnabled, workspaceAccountID]); |
There was a problem hiding this comment.
Skip redundant card-settings reads on accounting page mount
This effect calls openPolicyExpensifyCardsPage on every mount whenever cards are enabled, but it never checks whether the workspace’s card settings have already been loaded (hasOnceLoaded). In practice, revisiting Accounting repeatedly will trigger unnecessary OPEN_POLICY_EXPENSIFY_CARDS_PAGE reads and extra Onyx loading merges for already-cached data, which adds avoidable network/backend load and state churn.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Expensify Cards can be updated from another platform, so we need to refetch to ensure we get the latest data instead of navigating to the Expensify Card page to fetch it.
JmillsExpensify
left a comment
There was a problem hiding this comment.
Fix looks good for product.
|
🚧 @carlosmiceli 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! 🧪🧪
|
|
✋ 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/carlosmiceli in version: 9.3.40-0 🚀
|
|
🚀 Deployed to staging by https://github.com/carlosmiceli in version: 9.3.40-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.41-4 🚀
|
Explanation of Change
When the backend sends Phase 2 nested card settings format (where
paymentBankAccountIDlives insideUS,CURRENT, orGBsub-objects rather than at the root level), two things break:isExpensifyCardFullySetUpinCardUtils.tscheckscardSettings?.paymentBankAccountIDat the root level only, returningfalseeven when the card is fully set up — hiding the Card reconciliation option on the Accounting page.CardReconciliationPage.tsxreadspaymentBankAccountIDdirectly from the root of the card settings object, causingshouldShowto befalseand rendering the "Hmm... it's not here" not-found page.This PR updates both locations to use the existing
getCardSettings()helper fromCardUtils.ts, which correctly resolvespaymentBankAccountIDfrom nested sub-objects (Phase 2 format) while remaining backward-compatible with flat root-level settings.Fixed Issues
$ #84740
PROPOSAL: #84740 (comment)
Tests
Offline tests
N/A — this change only affects how existing data is read from Onyx; no new network requests are added.
QA Steps
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