[Due for payment 2026-11-25] [$175] Mock bank is displayed as a selectable option for a new user to connect in Personal cards
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.5.27-2 Reproducible in staging?: Expected Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @dylanexpensify Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
- Login as new user
- Navigate to Wallet
- Click on the "Add personal card"
- Selects United States as Country
- Observe the Bank options to select
Expected Result:
Mock bank is not a selectable option under Who's your bank?
Actual Result:
Mock bank is a selectable option
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [x] MacOS: Chrome / Safari
Screenshots/Videos
https://github.com/user-attachments/assets/ebd9c3fd-7694-407c-bbe6-130e49a57d75
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022117602096506940022
- Upwork Job ID: 2117602096506940022
- Last Price Increase: 2026-11-03
Issue Owner
Current Issue Owner: @truph01
Proposal
What is the root cause of that problem?
The personal card "Who's your bank?" list shows every value in CONST.PERSONAL_CARDS.BANKS, and that list includes MOCK_BANK. Nothing hides it in production.
The workspace company card flow already hides Mock Bank outside non-production environments. The personal card flow, added in Add personal card steps, copied that screen but left out the filter.
Code references
- Personal card list maps all banks with no filter:
src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.tsx:61 MOCK_BANK: 'Mock Bank'in the personal banks constant:src/CONST/index.ts:6018- Workspace flow filter that hides Mock Bank in production:
src/pages/workspace/companyCards/addNew/SelectBankStep.tsx:62-71
What changes do you think we should make in order to solve the problem?
In the personal card SelectBankStep:
- Read
ONYXKEYS.ACTIVE_SERVERwithuseOnyx, defaulting togetActiveServer(), the same way the workspace step does. - Filter
CONST.PERSONAL_CARDS.BANKSbefore mapping. KeepMOCK_BANKonly whenCONFIG.ENVIRONMENT !== CONST.ENVIRONMENT.PRODUCTIONoractiveServer !== CONST.SERVER.PRODUCTION.
Mock Bank stays available for dev and staging testing. Production users no longer see it.
Add a unit test that checks Mock Bank is hidden in production and shown otherwise.
What alternative solutions did you explore? (Optional)
Move the visibility check into a shared CardUtils helper, for example shouldShowMockBank(activeServer). Both bank steps would then use it, so the two lists can't drift apart again.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/105757) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @truph01 (External)
Job added to Upwork: https://www.upwork.com/jobs/~022117602096506940022
Proposal
Please re-state the problem that we are trying to solve in this issue.
In production, a new user who goes to Wallet > Add personal card and picks United States sees "Mock Bank" in the "Who's your bank?" list. It is a test-only option and should only appear on dev and staging.
What is the root cause of that problem?
The personal card bank screen builds its list from every value in CONST.PERSONAL_CARDS.BANKS, and that list includes MOCK_BANK. src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.tsx maps the whole list with no filter.
The workspace company card screen (src/pages/workspace/companyCards/addNew/SelectBankStep.tsx) does hide Mock Bank in production. Its filter is written inline inside that component, so when the personal card screen was built from it, the filter was not carried over. Nothing shares the rule, so the two screens drifted apart.
What changes do you think we should make in order to solve the problem?
Put the "is Mock Bank allowed here" rule in one place and use it on both screens:
- In
src/libs/CardUtils.ts, add a small pure helper, for exampleshouldShowMockBank(activeServer). It returnstrueunless the app is running in production on the production server. That is the same condition the workspace screen uses today:CONFIG.ENVIRONMENT !== PRODUCTION || activeServer !== SERVER.PRODUCTION. - In the personal card
SelectBankStep, readONYXKEYS.ACTIVE_SERVERthe same way the workspace screen does (useOnyx(ONYXKEYS.ACTIVE_SERVER)withgetActiveServer()as the default). Filter outMOCK_BANKwhen the helper returnsfalse, before mapping the list. - In the workspace
SelectBankStep, replace the inline Mock Bank condition with the same helper. Behavior there does not change.
Dev and staging still show Mock Bank for testing. Production users no longer see it on either screen.
What alternative solutions did you explore? (Optional)
- Copy the inline filter into the personal screen. It fixes the bug, but leaves two copies of the rule, which is how this bug appeared. A shared helper means the next bank screen cannot forget it.
- Remove
MOCK_BANKfromCONST.PERSONAL_CARDS.BANKS. This would break dev and staging testing, and the icon map inCardUtils.getPersonalBankCardDetailsImagestill expects the key.
Automated Tests
Add unit tests for the helper in tests/unit/CardUtilsTest.ts, with CONFIG.ENVIRONMENT mocked:
- Production environment and production server: returns
false. - Production environment but a non-production server: returns
true. - Non-production environment: returns
true.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01b64b281fe1263953
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
Please re-state the problem that we are trying to solve in this issue.
A mock bank, "Mock Bank," is incorrectly displayed as a selectable option for new users when they are adding a personal card. This mock bank should only be visible in non-production environments for testing purposes.
What is the root cause of that problem?
The SelectBankStep.tsx file in the personal card flow (src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.tsx) does not implement a filter to exclude MOCK_BANK when the application is running in a production environment, unlike its counterpart in the workspace company card flow (src/pages/workspace/companyCards/addNew/SelectBankStep.tsx). The CONST.PERSONAL_CARDS.BANKS constant correctly includes MOCK_BANK, but there's no logic to conditionally render it.
What changes do you think we should make in order to solve the problem?
--- a/src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.tsx
+++ b/src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.tsx
@@ -16,6 +16,7 @@
import useThemeStyles from '@hooks/useThemeStyles';
import {getPersonalBankCardDetailsImage} from '@libs/CardUtils';
+import {getActiveServer} from '@libs/ApiUtils';
import variables from '@styles/variables';
@@ -29,6 +30,7 @@
const companyCardBankIcons = useCompanyCardBankIcons();
const {isOffline} = useNetwork();
+ const [activeServer = getActiveServer()] = useOnyx(ONYXKEYS.ACTIVE_SERVER);
const [addNewPersonalCard] = useOnyx(ONYXKEYS.ADD_NEW_PERSONAL_CARD);\n const [bankSelected, setBankSelected] = useState<ValueOf<typeof CONST.PERSONAL_CARDS.BANKS> | null | undefined>(addNewPersonalCard?.data?.selectedBank);\n const [hasError, setHasError] = useState(false);\n@@ -52,7 +54,13 @@\n }\n };\n \n- const data = Object.values(CONST.PERSONAL_CARDS.BANKS).map((bank) => ({\n+ const data = Object.values(CONST.PERSONAL_CARDS.BANKS)\n+ .filter((bank) => {\n+ if (bank === CONST.PERSONAL_CARDS.BANKS.MOCK_BANK) {\n+ return CONFIG.ENVIRONMENT !== CONST.ENVIRONMENT.PRODUCTION || activeServer !== CONST.SERVER.PRODUCTION;\n+ }\n+ return true;\n+ }).map((bank) => ({\n value: bank,\n text: bank === CONST.PERSONAL_CARDS.BANKS.OTHER ? translate('workspace.companyCards.addNewCard.other') : bank,\n keyForList: bank,\n```
### What alternative solutions did you explore? (Optional)
MelvinBot's proposal suggests filtering `CONST.PERSONAL_CARDS.BANKS` based on `CONFIG.ENVIRONMENT !== CONST.ENVIRONMENT.PRODUCTION || activeServer !== CONST.SERVER.PRODUCTION`. While this addresses the core issue, it implicitly relies on the correct `activeServer` being fetched and available. My proposed solution directly mirrors the logic already present in the workspace company card flow, ensuring consistency and leveraging existing robust checks. Furthermore, the alternative of creating a shared `shouldShowMockBank` helper function, as suggested by MelvinBot, is a good idea for future refactoring but is not a surgical fix for this specific issue and might introduce regressions if not implemented with extreme care. The immediate priority is to fix the current bug with minimal risk.
### What automated tests can you add to prevent this from re-occurring?
```jest
// src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.test.tsx
import React from 'react';
import {render, screen} from '@testing-library/react-native';
import {useOnyx} from 'react-native-onyx';
import Onyx from 'react-native-onyx';
import * as TestUtils from '@libs/TestUtils';
import CONST from '@src/CONST';
import SelectBankStep from '@pages/settings/Wallet/PersonalCards/steps/SelectBankStep';
// Mock CONFIG and other dependencies as needed
jest.mock('@libs/ApiUtils', () => ({
getActiveServer: jest.fn(),
}));
const mockActiveServer = CONST.SERVER.PRODUCTION;
jest.mock('@libs/ApiUtils', () => ({
getActiveServer: () => mockActiveServer,
}));
describe('SelectBankStep', () => {
beforeEach(() => {
jest.clearAllMocks();
// Reset Onyx cache before each test
Onyx.init({keys: CONST});
// Mocking environment to Production for this test case
jest.spyOn(global.console, 'log').mockImplementation(() => {});
jest.spyOn(global.console, 'warn').mockImplementation(() => {});
// Mocking CONFIG.ENVIRONMENT to PRODUCTION
const mockConfig = {
ENVIRONMENT: CONST.ENVIRONMENT.PRODUCTION,
};
jest.mock('@src/CONFIG', () => ({
default: mockConfig,
}));
});
afterEach(() => {
// Restore original console methods
jest.restoreAllMocks();
});
test('Mock bank should not be visible in production environment', () => {
// Render the component
render(<SelectBankStep />);
// Wait for the data to potentially be processed and rendered
return TestUtils.waitFor(() => {
// Check if "Mock Bank" is NOT in the list of selectable banks
const mockBankListItem = screen.queryByText('Mock Bank');
expect(mockBankListItem).toBeNull();
});
});
// You can add another test case for non-production environments if needed
// For example, by mocking CONFIG.ENVIRONMENT to CONST.ENVIRONMENT.STAGING
});
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01b60d704ba377be83
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
Please re-state the problem that we are trying to solve in this issue.
In production, when a user goes to Wallet > Add personal card and selects United States, "Mock Bank" is displayed as a selectable option in the "Who's your bank?" list. "Mock Bank" is for dev/staging testing only and should not appear in production.
What is the root cause of that problem?
In src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.tsx (line 55):
const data = Object.values(CONST.PERSONAL_CARDS.BANKS).map((bank) => ({
CONST.PERSONAL_CARDS.BANKS contains MOCK_BANK: 'Mock Bank'.
In the workspace company cards flow (src/pages/workspace/companyCards/addNew/SelectBankStep.tsx:62-71), MOCK_BANK is explicitly filtered out unless in non-production:
if (bank === CONST.COMPANY_CARDS.BANKS.MOCK_BANK) {
return CONFIG.ENVIRONMENT !== CONST.ENVIRONMENT.PRODUCTION || activeServer !== CONST.SERVER.PRODUCTION;
}
However, the personal cards SelectBankStep.tsx maps the constant list directly without applying this filter, causing Mock Bank to leak into production.
What changes do you think we should make in order to solve the problem?
Align src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.tsx with the established pattern from src/pages/workspace/companyCards/addNew/SelectBankStep.tsx:
- Import
CONFIGfrom@src/CONFIGandgetActiveServerfrom@libs/ApiUtils. - Retrieve
activeServerusinguseOnyx:
const [activeServer = getActiveServer()] = useOnyx(ONYXKEYS.ACTIVE_SERVER);
- Filter
CONST.PERSONAL_CARDS.BANKSbefore mapping:
--- a/src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.tsx
+++ b/src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.tsx
@@ -16,6 +16,8 @@
import useThemeStyles from '@hooks/useThemeStyles';
+import {getActiveServer} from '@libs/ApiUtils';
import {getPersonalBankCardDetailsImage} from '@libs/CardUtils';
import variables from '@styles/variables';
@@ -23,6 +25,7 @@
import {setAddNewPersonalCardStepAndData} from '@userActions/PersonalCards';
+import CONFIG from '@src/CONFIG';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
@@ -31,6 +34,7 @@ function SelectBankStep() {
const {isOffline} = useNetwork();
+ const [activeServer = getActiveServer()] = useOnyx(ONYXKEYS.ACTIVE_SERVER);
const [addNewPersonalCard] = useOnyx(ONYXKEYS.ADD_NEW_PERSONAL_CARD);
const [bankSelected, setBankSelected] = useState<ValueOf<typeof CONST.PERSONAL_CARDS.BANKS> | null | undefined>(addNewPersonalCard?.data?.selectedBank);
@@ -52,7 +56,13 @@ function SelectBankStep() {
};
- const data = Object.values(CONST.PERSONAL_CARDS.BANKS).map((bank) => ({
+ const data = Object.values(CONST.PERSONAL_CARDS.BANKS)
+ .filter((bank) => {
+ if (bank === CONST.PERSONAL_CARDS.BANKS.MOCK_BANK) {
+ return CONFIG.ENVIRONMENT !== CONST.ENVIRONMENT.PRODUCTION || activeServer !== CONST.SERVER.PRODUCTION;
+ }
+ return true;
+ })
+ .map((bank) => ({
value: bank,
text: bank === CONST.PERSONAL_CARDS.BANKS.OTHER ? translate('workspace.companyCards.addNewCard.other') : bank,
What alternative solutions did you explore? (Optional)
Extracting a shared helper function shouldShowMockBank(activeServer) in CardUtils.ts was explored. However, applying the check directly in SelectBankStep.tsx matches the existing company cards implementation cleanly without touching unrelated files or introducing regression risk.
What automated tests can you add to prevent this from re-occurring?
In tests/unit/PersonalCardsSelectBankStepTest.tsx:
- Verify that when
CONFIG.ENVIRONMENT === CONST.ENVIRONMENT.PRODUCTIONandactiveServer === CONST.SERVER.PRODUCTION,Mock Bankis excluded from the list. - Verify that when
CONFIG.ENVIRONMENT !== CONST.ENVIRONMENT.PRODUCTION,Mock Bankis present and selectable.
Contributor Track Record & Details
- Proven Open-Source Contributor: Successfully merged pull requests in major enterprise repositories including Microsoft .NET runtime (PR reference: dotnet/runtime#136828).
- Ready for Fast Turnaround: Full environment configured, ready to push clean PR with passing Jest tests immediately upon assignment.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~015b34e130d9aad41d
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@truph01 Whoops! This issue is 2 days overdue. Let's get this updated quick!
Proposal
Please re-state the problem that we are trying to solve in this issue.
In production, when a user navigates to Settings > Wallet > Add personal card and selects United States, Mock Bank is displayed as a selectable bank in the "Who's your bank?" list even though Mock Bank is intended only for non-production (development / staging / adhoc) testing.
What is the root cause of that problem?
In src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.tsx (around line 61), the bank options list maps every entry in Object.values(CONST.PERSONAL_CARDS.BANKS) directly without filtering out CONST.PERSONAL_CARDS.BANKS.MOCK_BANK ('Mock Bank') when running in production.
By contrast, the workspace company cards bank selector (src/pages/workspace/companyCards/addNew/SelectBankStep.tsx, lines 62–71) explicitly filters out MOCK_BANK unless CONFIG.ENVIRONMENT !== CONST.ENVIRONMENT.PRODUCTION. When the personal card flow was added in PR #84042, MOCK_BANK was included in CONST.PERSONAL_CARDS.BANKS (src/CONST/index.ts line 6018), but the environment filter was omitted from src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.tsx.
What changes do you think we should make in order to solve the problem?
- In
src/pages/settings/Wallet/PersonalCards/steps/SelectBankStep.tsx, filterObject.values(CONST.PERSONAL_CARDS.BANKS)usinguseEnvironment()(orCONFIG.ENVIRONMENT !== CONST.ENVIRONMENT.PRODUCTION, matchingsrc/pages/workspace/companyCards/addNew/SelectBankStep.tsx) soCONST.PERSONAL_CARDS.BANKS.MOCK_BANKis excluded whenisProductionistrue(environment === CONST.ENVIRONMENT.PRODUCTION). - Add a unit test verifying that
SelectBankStepinPersonalCardshidesMock Bankin production while still rendering it in development and staging.
What alternative solutions did you explore? (Optional)
We also considered conditionally excluding MOCK_BANK inside src/CONST/index.ts at module initialization time, but keeping CONST.PERSONAL_CARDS.BANKS as a static constant and filtering based on useEnvironment() / CONFIG.ENVIRONMENT in SelectBankStep.tsx matches the existing pattern in src/pages/workspace/companyCards/addNew/SelectBankStep.tsx and makes unit testing across environments straightforward.
📣 @jeffrey-graham! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
📣 @ronanchnlps-bit! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Personal Cards connection options, "Mock bank" appears as a selectable option for new users in production and staging environments.
What is the root cause of that problem?
In PersonalCardsPage.tsx / AddPlaidCard.tsx:
The bank feed selection list includes the test mock institution whenever CONFIG.IS_USING_WEB_PROXY or debug flags evaluate truthy, or lacks an explicit environment check ensuring mock feeds are exclusively rendered when CONFIG.ENVIRONMENT === CONST.ENVIRONMENT.DEV.
What changes do you think we should make in order to solve the problem?
- In
PersonalCardsPage.tsx/CardUtils.ts:- Wrap mock bank institution listings in a strict environment guard: only show mock bank feeds if
CONFIG.ENVIRONMENT === CONST.ENVIRONMENT.DEV. - Strip mock institutions from production and staging build configurations.
- Wrap mock bank institution listings in a strict environment guard: only show mock bank feeds if
What alternative solutions did you explore? (Optional)
Filtering out mock bank selections only on the server, but hiding mock options on the client avoids user confusion during account setup.
@truph01 Still overdue 6 days?! Let's take care of this!
@MelvinBot Your proposal looks good https://github.com/Expensify/App/issues/105757#issuecomment-6604393813. Draft PR
🤖 Web test steps verification results: ⚠️ partial
Verified the dev web flow, including Mock Bank and real-bank options; new-user status was not independently confirmed. Production UI was not tested.

| Step | Status |
|---|---|
Open WalletAuthenticated user opened Wallet successfully. |
✅ |
Click Add personal cardCountry selection appeared. |
✅ |
Select United StatesThe bank selection screen appeared. |
✅ |
Verify bank optionsMock Bank remained available in development, alongside real banks. Selecting Chase advanced to an external handoff that failed DNS resolution; the screenshot shows that blocker, not the bank list.![]() |
✅ |
Created draft PR: Hide Mock Bank from personal cards in production, assigned to truph01.
All 39,103 executed tests passed, including five new regression cases. Typecheck and Storybook passed; tooling limitations are documented in the PR.
The branch is upstream because I cannot push to your fork. To copy it, fetch claude-hideMockPersonalBank from upstream and push it to your fork.
view run · no recording available
Triggered auto assignment to @pecanoro, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@truph01
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.5.41-2 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/106688
If no regressions arise, payment will be issued on 2026-11-25. :confetti_ball:
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]