Skip to content

Remove Manager McTest references from frontend#91084

Open
MelvinBot wants to merge 6 commits into
mainfrom
claude-removeManagerMcTest
Open

Remove Manager McTest references from frontend#91084
MelvinBot wants to merge 6 commits into
mainfrom
claude-removeManagerMcTest

Conversation

@MelvinBot
Copy link
Copy Markdown
Contributor

@MelvinBot MelvinBot commented May 19, 2026

Explanation of Change

Manager McTest is no longer supported on the backend. This PR removes all frontend references to Manager McTest, including:

  • Constants: EMAIL.MANAGER_MCTEST, BETAS.NEWDOT_MANAGER_MCTEST, ACCOUNT_ID.MANAGER_MCTEST, and exclusion list entries
  • Utility functions: isSelectedManagerMcTest(), isTestTransactionReport(), getManagerMcTestParticipant(), isManagerMcTestQuickActionReport(), getRestrictedLogins()
  • Special handling: Manager McTest overrides in buildOptimisticIOUReportAction, buildOptimisticReportPreview, getMoneyRequestOptions, shouldDisableThread, money request builder flows, scan receipt participant routing, Quick Action Bar restrictions, and participant search filtering
  • Tests: Removed all Manager McTest-specific test cases and fixtures

Fixed Issues

$ #91068

Tests

  1. Create an expense (Submit flow)

    • Open the app, tap the + FAB > Submit expense
    • Scan a receipt or enter an amount manually
    • Select a participant and submit the expense
    • Verify the expense is created successfully with no errors
  2. Create an expense (Split flow)

    • Open the app, tap + FAB > Split expense
    • Add participants, enter amount, and split
    • Verify the split is created with no errors
  3. Duplicate expense action

    • Find an existing expense, open the secondary actions menu
    • Tap Duplicate
    • Verify the duplicate action works correctly
  4. Quick Action Bar

    • Navigate to a DM chat
    • Verify the Quick Action Bar appears and all quick actions (Submit, Track, etc.) function correctly
    • Verify no errors in the console
  5. Search participants

    • Start creating a new expense
    • On the participant search screen, search for various users
    • Verify Expensify system accounts (Concierge, etc.) behave as expected — no unexpected accounts appear
  6. Thread creation

    • Open an expense report action
    • Verify threading works normally on expense report actions
  7. Verify no console errors

    • Perform all the above flows while monitoring the JS console
    • Verify no errors appear related to Manager McTest or missing references

Offline tests

N/A — this is a code removal PR with no new offline behavior.

QA Steps

  1. Create a new Submit expense (scan a receipt) on a personal account with no workspace — verify it works end-to-end
  2. Create a new Submit expense with a manual amount — verify it works
  3. Open an existing expense and use the Duplicate action — verify it works
  4. Check Quick Action Bar on a DM chat — verify quick actions appear and work
  5. Start a new expense and search for participants — verify the search works correctly
  6. Verify no JS console errors throughout all flows

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 followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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.

AI Tests

Test Result
npm run typecheck-tsgo Passed (only pre-existing errors in MapView/utils.ts and ConvertGpsPointsTo2DArray.ts)
npm run lint-changed Passed
npm run prettier Passed
npm test -- ReportUtilsTest, QuickActionUtilsTest, OptionsListUtilsTest, PersonalDetailOptionsListUtilsTest, IOUTest, MoneyRequestTest, useReceiptScan 1900/1901 passed. 1 pre-existing failure in QuickActionUtilsTest (confirmed failing on main)

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Manager McTest is no longer supported on the backend. This removes all
frontend references including constants, utility functions, special
handling in money request flows, Quick Action Bar restrictions, and
participant filtering logic.

Co-authored-by: Ishpaul Singh <ishpaul777@users.noreply.github.com>
…Policy and spy canCreateRequest

The per diem test mocked isPaidGroupPolicy but the source code calls isControlPolicy.
Both per diem and time tracking positive tests also need canCreateRequest mocked since
the minimal test data doesn't satisfy the real canCreateRequest conditions.

Co-authored-by: Ishpaul Singh <ishpaul777@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

Fixed the failing QuickActionUtilsTest check:

  1. Per diem test mocked isPaidGroupPolicy but the source code calls isControlPolicy — corrected the mock target.
  2. Both per diem and time tracking positive tests needed canCreateRequest spied to return true, since the minimal stub data doesn't satisfy the real canCreateRequest conditions.

All 11 tests now pass.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

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/CONST/index.ts 92.30% <ø> (ø)
src/hooks/useExpenseActions.ts 0.00% <ø> (ø)
src/libs/OptionsListUtils/index.ts 84.49% <100.00%> (-0.25%) ⬇️
src/libs/QuickActionUtils.ts 31.91% <ø> (-4.45%) ⬇️
src/libs/ReportUtils.ts 83.21% <ø> (-0.09%) ⬇️
src/pages/iou/request/ParticipantSearchResults.tsx 0.66% <ø> (+0.02%) ⬆️
...es/iou/request/step/IOURequestStepConfirmation.tsx 66.56% <100.00%> (-0.11%) ⬇️
...RequestStepScan/components/MobileWebCameraView.tsx 0.00% <ø> (ø)
...st/step/IOURequestStepScan/hooks/useReceiptScan.ts 91.30% <ø> (+0.25%) ⬆️
.../request/step/confirmation/useExpenseSubmission.ts 53.77% <ø> (+1.07%) ⬆️
... and 4 more
... and 353 files with indirect coverage changes

MelvinBot and others added 2 commits May 19, 2026 14:33
…cTest

Co-authored-by: Ishpaul Singh <ishpaul777@users.noreply.github.com>
…tead of policy ID string

After merging main, the new shouldRestrictUserBillableActions calls from
PR \#88363 were passing defaultExpensePolicy.id (a string) where the
function expects OnyxEntry<Policy>. This fixes all 5 call sites.

Co-authored-by: Ishpaul Singh <ishpaul777@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

Fixed the failing typecheck: after merging main, the new shouldRestrictUserBillableActions calls from #88363 were passing defaultExpensePolicy.id (a string) where the function expects OnyxEntry<Policy>. Updated all 5 call sites to pass the full policy object instead.

…t removal

Co-authored-by: Ishpaul Singh <ishpaul777@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

Fixed the failing ESLint checks: removed unused imports and variables left over from the Manager McTest removal (getChatByParticipants in OptionsListUtils, deprecatedCurrentUserPersonalDetails and personalDetails in MoneyRequestBuilder, ReportUtils in MoneyRequestTest).

The Jest failure in QuickActionUtilsTest is pre-existing (fails on main) and unrelated to this PR.

@ishpaul777
Copy link
Copy Markdown
Contributor

@MelvinBot the action are not running please run those

@MelvinBot
Copy link
Copy Markdown
Contributor Author

The CI actions are already running — all checks currently show pending status, meaning they've been triggered and are in progress. Give them a few minutes to complete. You can monitor progress here: https://github.com/Expensify/App/pull/91084/checks

@MelvinBot
Copy link
Copy Markdown
Contributor Author

⚠️ MelvinBot CI Fix Loop Detected

MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR.

Next steps: A human should review the recent commits and resolve the conflicting CI errors manually.

@ishpaul777
Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

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

@ishpaul777
Copy link
Copy Markdown
Contributor

@MelvinBot please make it ready for review

@MelvinBot MelvinBot marked this pull request as ready for review May 21, 2026 16:47
@MelvinBot MelvinBot requested a review from a team as a code owner May 21, 2026 16:47
@MelvinBot
Copy link
Copy Markdown
Contributor Author

PR has been marked as ready for review as requested.

Note: The Tests and QA Steps sections in the PR description still contain TODO placeholders — please fill those in so reviewers have testing context.

@melvin-bot melvin-bot Bot requested review from joekaufmanexpensify and linhvovan29546 and removed request for a team May 21, 2026 16:47
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented May 21, 2026

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

@ishpaul777
Copy link
Copy Markdown
Contributor

@MelvinBot please suggest testing steps for this and add it in PR description

@MelvinBot
Copy link
Copy Markdown
Contributor Author

Updated the PR description with suggested testing steps covering the key areas affected by the Manager McTest removal:

  1. Submit expense — ensures the core expense creation flow still works without Manager McTest participant routing
  2. Split expense — validates split flow is unaffected
  3. Duplicate action — tests the shouldRestrictUserBillableActions signature change
  4. Quick Action Bar — confirms QAB no longer has Manager McTest restrictions
  5. Participant search — verifies Manager McTest no longer appears in search results
  6. Thread creation — ensures threading on expense actions works without the Manager McTest thread-disable logic
  7. Console error check — catch any missing references

Please review and adjust as needed before testing.

@ishpaul777
Copy link
Copy Markdown
Contributor

ishpaul777 commented May 21, 2026

@MelvinBot a few things to address before this is ready:

  1. Leftover Manager McTest references not cleaned up Two references were missed:
  • src/types/onyx/Transaction.ts - the JSDoc still says Receipt is manager_mctest@expensify.com testing receipt. The isTestReceipt field itself is still used by useReceiptTraining, ReceiptFileValidator, etc. for the receipt-training tooltip / CONST.TEST_RECEIPT flow, so the field can stay, but please update the comment so it no longer references Manager McTest.
  • .env.example line 38 - EXPENSIFY_ACCOUNT_ID_MANAGER_MCTEST=-1 is dangling now that CONST.ACCOUNT_ID.MANAGER_MCTEST was removed. Please delete that line.
  1. Unrelated change bundled in
    The PR also rewrites 5 call sites of shouldRestrictUserBillableActions from (defaultExpensePolicy.id, ...) to (defaultExpensePolicy, ...) in MoneyRequestHeaderSecondaryActions.tsx, useExpenseActions.ts, and useSearchBulkActions.ts. This is a typecheck fix forced by #88363 after the merge with main and is unrelated to Manager McTest removal. please check if its already fixed on main and sync main

- Update JSDoc comment on isTestReceipt in Transaction.ts (remove manager_mctest reference)
- Delete dangling EXPENSIFY_ACCOUNT_ID_MANAGER_MCTEST from .env.example
- Restore eslint-disable comment in useSearchBulkActions.ts (unrelated removal)

Co-authored-by: Ishpaul Singh <ishpaul777@users.noreply.github.com>
@MelvinBot MelvinBot requested a review from a team as a code owner May 21, 2026 17:00
@melvin-bot melvin-bot Bot requested review from ZhenjaHorbach and removed request for a team May 21, 2026 17:00
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented May 21, 2026

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

@MelvinBot
Copy link
Copy Markdown
Contributor Author

Pushed fixes in f069557:

  1. Transaction.ts JSDoc — Updated comment on isTestReceipt to remove the Manager McTest reference (src/types/onyx/Transaction.ts:238)
  2. .env.example — Deleted the dangling EXPENSIFY_ACCOUNT_ID_MANAGER_MCTEST=-1 line
  3. useSearchBulkActions.ts — Restored the /* eslint-disable react-hooks/refs */ comment that was unintentionally removed

Re: unrelated shouldRestrictUserBillableActions changes — I checked and main already has the updated signature (takes Policy object, not policy.id). The only diff this PR has vs main in useExpenseActions.ts is the currentUsercurrentUserAccountID/currentUserLogin flattening, which is actually part of the Manager McTest removal (the CurrentUser type from Policy.ts was removed in this PR). So that change is intentional and related. The useSearchBulkActions.ts unrelated change (eslint comment removal) has been reverted. MoneyRequestHeaderSecondaryActions.tsx has no diff vs main in this PR.

Note: I was unable to merge main into this branch due to unrelated histories (the branch was created from a standalone snapshot). If a main sync is needed, the branch may need to be recreated.

@ishpaul777 ishpaul777 removed the request for review from ZhenjaHorbach May 21, 2026 17:01
Copy link
Copy Markdown
Contributor

@joekaufmanexpensify joekaufmanexpensify left a comment

Choose a reason for hiding this comment

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

Good for product

@linhvovan29546
Copy link
Copy Markdown
Contributor

@MelvinBot Please remove MCTEST in the cspell.json as well

@MelvinBot
Copy link
Copy Markdown
Contributor Author

Good catch — I can see MCTEST in cspell.json. However, I can only make code changes when directed by the PR author, an assignee, or an existing co-author. To have me implement this, the PR assignee (ishpaul777) should reply with a request tagging me.

@linhvovan29546
Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari

@linhvovan29546
Copy link
Copy Markdown
Contributor

@ishpaul777 I can still search for manager_mctest@expensify.com. Do we need to remove this as well?
Screenshot 2026-05-22 at 21 15 02

@ishpaul777
Copy link
Copy Markdown
Contributor

ishpaul777 commented May 22, 2026

manager_mctest@expensify.com is just a normal account thats why it shows in search i dont think its a frontend change we might need to delete it from db

@linhvovan29546
Copy link
Copy Markdown
Contributor

Yeah, I mean deleting it from the db

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.

4 participants