Skip to content

Fix import/no-cycle - part 25 - #108190

Open
LukasMod wants to merge 5 commits into
Expensify:mainfrom
callstack-internal:refactor/no-cycle-part-25
Open

LukasMod wants to merge 5 commits into
Expensify:mainfrom
callstack-internal:refactor/no-cycle-part-25

Conversation

@LukasMod

@LukasMod LukasMod commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Part 25 of the import/no-cycle cleanup. PolicyUtils/members.ts and ReportUtils.ts no longer import the BankAccounts action, which cuts 5 findings in src (25 to 20, measured with oxlint with the eslint-disable comments stripped).

  • getEligibleBankAccountShareRecipientEmails and hasEligibleBankAccountShareRecipient take the bank account itself instead of its ID. ShareBankAccount reads it with a new bankAccountByIDSelector (src/selectors/BankAccount.ts), and WalletPage looks it up in the list it already had. Three Wallet pages that had the same inline selector now use the shared one.
  • getReportPreviewMessage reads the account a settled invoice was paid with from its bankAccountList param, which is now required. OptionsListUtils, useSearchSelector and the Search autocomplete pass the list in.
  • getBankAccountFromID had no callers left, so it is removed.

Side effect: Search autocomplete and the task share picker now receive bankAccountList, so they use the same fallback as the LHN and report actions: when a business bank account payment's action has no accountNumber (e.g. an older payment), the last 4 digits are looked up in bankAccountList instead of showing blank. New payments made in the app record accountNumber on the optimistic action, so they show the digits either way.

Fixed Issues

$ #99650
PROPOSAL:

Tests

  1. As a workspace admin with a verified business bank account and at least one other admin in that workspace, go to Settings > Wallet.
  2. Tap the business bank account and verify the menu shows Share.
  3. Tap Share and verify the list shows the other workspace admins, without anyone the account was already shared with.
  4. Go offline (can't do it online with dev test bank account), then pay a workspace expense report with Pay with business bank account.
  5. Press Cmd+K, search for that expense report and verify its preview shows "paid with bank account 1234", the same as in the LHN.

The invoice last-4 lookup is covered by the ReportUtilsTest unit test names the invoice payment account from the passed bankAccountList.

  • Verify that no errors appear in the JS console

Offline tests

No offline-specific behavior changes

QA Steps

Same as tests.

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
android.mov
Android: mWeb Chrome
iOS: Native
ios.1-3.mov
ios.4-5.mov
ios 5
iOS: mWeb Safari
MacOS: Chrome / Safari
web.1-3.mov
web.4-5.mov
web 5

@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

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.

Files with missing lines Coverage Δ
src/components/Search/SearchAutocompleteList.tsx 91.11% <100.00%> (+0.02%) ⬆️
src/hooks/useAutocompleteSuggestions.ts 72.44% <ø> (ø)
src/hooks/useSearchSelector/base.ts 92.18% <100.00%> (+0.08%) ⬆️
src/libs/OptionsListUtils/index.ts 92.65% <ø> (ø)
src/libs/PolicyUtils/members.ts 88.31% <100.00%> (-0.08%) ⬇️
src/libs/ReportUtils.ts 91.63% <100.00%> (+0.07%) ⬆️
src/libs/actions/BankAccounts.ts 52.53% <ø> (-0.27%) ⬇️
...s/EnableGlobalReimbursementsBusinessPage/index.tsx 0.00% <0.00%> (ø)
...mbursements/EnableGlobalReimbursementsSignPage.tsx 0.00% <0.00%> (ø)
...ges/settings/Wallet/LinkPlaidToBankAccountPage.tsx 0.00% <0.00%> (ø)
... and 3 more
... and 9 files with indirect coverage changes

@LukasMod

Copy link
Copy Markdown
Contributor Author

@MelvinBot review

@LukasMod

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T16:40:52.749976Z 5360f41 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@MelvinBot

MelvinBot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Web test steps verification results: ⚠️ partial

Testing on dev NewDot web was blocked by navigation and unavailable fixtures. No product regression was demonstrated, and no payment was attempted.

Account opens Profile without visible Wallet navigation

Step Status
1. Open Settings → Wallet with required admin/bank prerequisitesAccount opened Profile; Wallet navigation and required prerequisites could not be established.
Account opens Profile without visible Wallet navigation
⚠️
2. Verify bank account menu shows ShareBlocked: bank account menu was unreachable.
⚠️
3. Verify eligible admins exclude existing shareesBlocked: sharing UI and admin/sharee fixtures unavailable.
⚠️
4. Settle an invoice using a bank accountNo safe payment fixture available; no payment attempted.
⚠️
5. Verify invoice preview includes paying account’s last four digitsBlocked: no settled invoice fixture available.
⚠️
6. Verify no JavaScript console errorsUnverified: console access unavailable through the supported tooling.
⚠️

Code review: No blocking issues found at 5253dae. CI tests, typecheck, lint, and React Compiler checks passed; manual behavior remains unverified.


view run · view recording

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 5253daec7c

ℹ️ 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".

@LukasMod LukasMod changed the title [NoQA] Fix import/no-cycle - part 25 Fix import/no-cycle - part 25 Nov 27, 2026
@LukasMod
LukasMod marked this pull request as ready for review November 27, 2026 16:04
@LukasMod
LukasMod requested review from a team as code owners November 27, 2026 16:04
@expensify-chore-bot
expensify-chore-bot Bot requested review from thelullabyy and removed request for a team November 27, 2026 16:04
@expensify-chore-bot

Copy link
Copy Markdown

@thelullabyy 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]

@expensify-chore-bot
expensify-chore-bot Bot requested review from JmillsExpensify and removed request for a team November 27, 2026 16:04
@LukasMod

Copy link
Copy Markdown
Contributor Author

@codex review

@LukasMod

Copy link
Copy Markdown
Contributor Author

@MelvinBot deep review

@MelvinBot

Copy link
Copy Markdown
Contributor

Deep review

No blocking regressions found at 5360f41.

Traced the changed helpers through their callers, including:

  • Invoice-account lookup and search preview data flow.
  • Preview cache invalidation: changing bankAccountList invalidates cached alternate text.
  • Wallet sharing eligibility, existing-sharee exclusions, selector reactivity, and numeric/string account IDs. No demonstrated behavior regression.

Non-blocking follow-ups

  • The SEARCH context enables previews but still omits bankAccountList. No current production consumer was found, so this is a dormant gap rather than a demonstrated user-facing bug. Forwarding the list would make that branch safe for future use.
  • Consider tests for the shared selector and sharee updates while the sharing screen remains mounted.

Validation

Ran five targeted suites covering policy utilities, report previews, alternate text, sidebar utilities, and search selectors: 3,014 tests passed. Jest emitted duplicate-mock warnings but no failures.

This was a code-level review; browser verification was not rerun. No source changes made.


view run

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 5360f41a6a

ℹ️ 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".

# Conflicts:
#	src/selectors/BankAccount.ts

@JmillsExpensify JmillsExpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No product review required

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants