Phase 3: Remove flat fallbacks and nest travel writes under TRAVEL_US#84501
Conversation
- Remove flat-format fallback from getCardSettings() — Phase 2 guarantees all settings are nested under program keys (CURRENT/US/GB) - Nest travel invoicing optimistic writes under TRAVEL_US key instead of writing at root level, preventing cross-program data pollution - Remove duplicate root-level isEnabled in deactivateTravelInvoicing - Update tests to reflect new behavior (undefined instead of flat root)
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@thesahindia 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] |
|
@parasharrajat @ikevin127 , would really appreciate if you guys can test the PR thoroughly 🙏 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 839d13c7ad
ℹ️ 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".
…rom travelSettings instead of raw cardSettings
src/pages/workspace/accounting/reconciliation/ReconciliationAccountSettingsPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/expensifyCard/WorkspaceSettlementAccountPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/expensifyCard/WorkspaceSettlementFrequencyPage.tsx
Outdated
Show resolved
Hide resolved
…ogramKey, add Log.alert on missing key
|
Addressed all the feedback 🟢 |
|
@parasharrajat any concerns from your side ? #84501 (comment) |
There was a problem hiding this comment.
LGTM. 2 small comments to keep the same naming convention everywhere.
Checklist: #84501 (comment)
🎀 👀 🎀 C+ reviewed
…ateSettlementAccount
ikevin127
left a comment
There was a problem hiding this comment.
Addressed all the feedback 🟢
Thanks, LGTM ✅
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @blimpich 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/blimpich in version: 9.3.40-0 🚀
|
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.3.40-0 🚀
|
|
Hi @allgandalf. We can’t change Settlement Frequency via Expensify card settings (only via Travel) Screen.Recording.2026-03-18.at.16.45.40.mp4 |
@IuliiaHerets That's the expected result of this PRs fix, so all good ✅ The Expensify Card related steps are a bit confusing and should be ignored since if Expensify Card's settlement frequency is Daily by default, you're not supposed to be able to change it. The issue that this PR fixed is that before, when Settlement Frequency was changed specifically for Travel Invoicing, that would affect Expensify card which wasn't desired. |
@ikevin127 just for your understanding we can update the frequency to monthly but you need a good balance history submited to EXFY :) (something on these terms, not really sure loll, i got to know this from @blimpich the other day). Which normal test accounts dont. Either ways shouldn't block our PR, thanks for prompt reply, posted the above message just for your knowledge |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.41-4 🚀
|
Explanation of Change
Phase 3 cleanup for issue #81472 (shared Onyx key between card feeds). Now that Phase 2 (Auth PR #20194) guarantees all card settings are nested under program keys (
CURRENTfor legacy,US/GBfor new domains), this PR removes the legacy flat-format fallbacks and nests travel invoicing optimistic writes underTRAVEL_US.Changes:
CardUtils.ts— Remove flat-format fallback fromgetCardSettings(). With Phase 2 deployed, all settings are nested, so the auto-detect chain (US→CURRENT→GB) always finds the correct program. Returnsundefinedinstead of the raw flat object when no nested key is found.TravelInvoicing.ts— Nest travel-specific data fields (paymentBankAccountID,monthlySettlementDate,isEnabled) underCONST.TRAVEL.PROGRAM_TRAVEL_USin all optimistic/success/failure data. This prevents cross-program data pollution when travel and standard card settings share the same Onyx key.CardUtilsTest.ts— Update 4 tests to expectundefinedinstead of flat root fallback.CardUtils.ts— AddedgetCardFeedCountry()helper that detects which card program key (US,CURRENT, orGB) exists in the settings object. Used by callers to determine the correct nested key for optimistic writes.Card.ts— UpdatedupdateSettlementFrequencyandupdateSettlementAccountto accept afeedCountryparameter and nest optimistic/success/failure writes under the program key when present. Falls back to flat writes whenfeedCountryis undefined.ReconciliationAccountSettingsPage.tsx,WorkspaceSettlementAccountPage.tsx,WorkspaceSettlementFrequencyPage.tsx— PassfeedCountryfromgetCardFeedCountry()to the updated Card.ts functions.Deploy after: Auth PR https://github.com/Expensify/Auth/pull/20194 is live and stable.DONEFixed Issues
$ #81472
$ #84394
Tests
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