Repository navigation
[Refactor] Move PolicyUtils vendor-matching helpers into vendor.ts - #103135
Conversation
Co-authored-by: nkdengineer <[email protected]>
|
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❌ 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.
|
|
🤖 Web test steps verification results: ✅ pass Inbox, Workspaces, the workspace Overview, More features, and Categories pages, and the Create expense flow all loaded correctly on dev NewDot web. No API call failed and no error appeared on screen. The browser tool can't capture the JS console on web, so this check used the screens and network traffic instead of a console log.
|
|
…one describe Co-authored-by: nkdengineer <[email protected]>
|
I pushed both changes in 0f2c4a8:
All 586 tests in |
|
@MelvinBot, fill out the Test section Precondition:
Then update |
|
I updated the PR description:
I changed "Campire" to "Campfire" in step 3. The rest of your wording is unchanged. |
|
@MelvinBot, fill the Screenshots/VideosAndroid: NativeScreen.Recording.2026-10-06.at.15.13.52.movAndroid: mWeb ChromeScreen.Recording.2026-10-06.at.15.14.35.moviOS: NativeScreen.Recording.2026-10-06.at.15.14.59.moviOS: mWeb SafariScreen.Recording.2026-10-06.at.15.13.25.movMacOS: Chrome / SafariScreen.Recording.2026-10-06.at.15.11.20.mov |
|
I filled the |
|
@MelvinBot, Update the Author Checklist section. Also, I verified there's no console error; then let's check for PR Author Checklist
|
|
I updated the PR description, but I couldn't mark the PR as ready for review. This run doesn't allow me to change the PR's draft status. Changes to the description:
The description now has 44 checked boxes and no unchecked ones. The PR is still a draft. Please click Ready for review on the PR yourself. |
|
@MelvinBot Mark the PR as ready. |
|
I couldn't mark this PR as ready for review. The To mark it ready yourself, click Ready for review at the bottom of the PR's Conversation tab. |
|
@nkdengineer 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] |
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. |
|
@MelvinBot Resolve conflict. |
…lsVendors Co-authored-by: nkdengineer <[email protected]> # Conflicts: # src/libs/PolicyUtils/index.ts
|
I merged The conflict came from [CP Staging] Revert "Add Vendor filter to expense Search". That revert changed vendor code that this PR moves out of
Nothing else references The PR description still mentions |
JmillsExpensify
left a comment
There was a problem hiding this comment.
No product review required.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-10-06.at.15.13.52.movAndroid: mWeb ChromeScreen.Recording.2026-10-06.at.15.14.35.moviOS: HybridAppScreen.Recording.2026-10-06.at.15.14.59.moviOS: mWeb SafariScreen.Recording.2026-10-06.at.15.13.25.movMacOS: Chrome / SafariScreen.Recording.2026-10-06.at.15.11.20.mov |
|
@blimpich All yours. |
|
✋ 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.5.4-0 🚀
|
|
No help site update is needed. This PR is a pure refactor: it moves the vendor-matching helpers from |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.5.4-3 🚀
Bundle Size Analysis (Sentry): |







Explanation of Change
PolicyUtils/index.tsis close to the 4000-linemax-linesESLint cap. Going over it breaks the build and blocks deploys and other PRs. This is step 2 of the agreed split: it moves the vendor-matching helpers intoPolicyUtils/vendor.ts. It is a pure move, with no renames, signature changes, or behavior changes.src/libs/PolicyUtils/vendor.tswith the block fromisQBOVendorMatchingActivethroughgetXeroSupplierByID. The moved lines are byte-identical to the originals.vendor.tsexports the 22 helpers from the plan, plusgetVendorFeaturePolicyIDs. That function sits inside the block, is already exported fromPolicyUtils, and only callshasVendorFeature, so it moves with the block.isQBOVendorMatchingActive,isIntacctVendorMatchingActive,isCampfireVendorMatchingActive, andgetActiveVendorMatchingVendorsstay private invendor.ts.vendor.tsdoes not importindex.ts, so there is no new cycle. Nothing left inindex.tscalls the vendor helpers.getQuickbooksOnlineIntegrationName(used bygetVendorEmptyState) now comes from@libs/AccountingUtilsinvendor.ts. The plan's import list missed it. The unusedVendorandTransactionCommentVendorimports were removed fromindex.ts.getSageIntacctVendors,getTagApproverRule, andgetValidConnectedIntegrationonward stay inindex.ts.@libs/PolicyUtils.PolicyUtilsTest.ts, every test for avendor.tsfunction now sits under onedescribe('vendor')block, like the existingdescribe('tag')block.sortVendorsmoved into it.getXeroExpenseAccountsmoved out, because it stays inindex.ts.index.tsdrops from 3473 to 2939 lines.One change from the plan:
index.tsre-exports the vendor helpers withexport * from './vendor', next to the existingexport * from './tag'. It does not list them in theexport { ... }block. With named re-exports, 23 Jest suites failed to load withTypeError: Cannot read properties of undefined (reading 'findVendorByID'). This is the same failure Phase 1 hit with./tag. The existing comment aboveexport * from './tag'explains why, and it now covers both lines. Only the 23 names in theexport { ... }block ofvendor.tsbecome public, so the 4 private helpers stay private.AI tests run (by MelvinBot):
npm run typecheck✅,npm run lint-changed✅,npm run fmt(no diff) ✅,npm run spell-changed✅, full Jest suite in 4 shards ✅ (1688 suites passed, 1 skipped, 0 failed). I did not run the Storybook smoke test, because this PR changes no components. After the rename tovendor.ts:npm run typecheck✅,npm run linton the changed files ✅,npm run fmt(no diff) ✅,PolicyUtilsTest.ts✅ (586 tests passed).Fixed Issues
$ #102675
PROPOSAL: #102675 (comment)
Tests
Precondition:
vendorMatchingbeta is enabledVendorsappears in the workspace menu itemVendorspageProductionOffline tests
Same as test
QA Steps
Same as test
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
Android: Native
Screen.Recording.2026-10-06.at.15.13.52.mov
Android: mWeb Chrome
Screen.Recording.2026-10-06.at.15.14.35.mov
iOS: Native
Screen.Recording.2026-10-06.at.15.14.59.mov
iOS: mWeb Safari
Screen.Recording.2026-10-06.at.15.13.25.mov
MacOS: Chrome / Safari
Screen.Recording.2026-10-06.at.15.11.20.mov