Skip to content

[No QA] Import QuickBooks Online bank rules as merchant rules - #108272

Closed
MelvinBot wants to merge 5 commits into
mainfrom
claude-importQuickBooksRules-TaduJR
Closed

MelvinBot wants to merge 5 commits into
mainfrom
claude-importQuickBooksRules-TaduJR

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

QuickBooks Online has no API for bank rules, but it can export them to a file. This PR lets a workspace connected to QuickBooks Online import that file as merchant rules from Rules > More > Import QuickBooks Online rules, without mapping any columns. The flow is an instructions page, the file upload, a review page with the counts and field mapping, and a summary after Import.

A QuickBooks Online rule is imported only when the merchant rule it becomes matches no expense the original wouldn't, and sets nothing the original doesn't. The exception is the bank account: an expense has none, so a rule limited to one bank account applies to every expense, which the instructions page says. Rules a merchant rule can't reproduce, such as money in, "Doesn't contain", split and exclude, are skipped. Settings that can't carry over, such as a category the workspace doesn't have, are left out, and rules the workspace already has aren't added again. When rules overlap, the higher rule in the file wins any field both set. A lower rule can still add a field the higher one doesn't set, because Expensify applies every matching rule. This was accepted in the proposal review, and the help article explains it.

No backend change is needed: the rules go through the existing ImportMerchantRulesSpreadsheet command. These shared parts changed, so they need a regression check:

  • The spreadsheet merchant rules importer and ImportSpreadsheet now share code with this import.
  • The Rules page now reads the workspace's connection data when it isn't loaded, because the option depends on it.
  • The connection and vendor reads now track their loading state, and the category and tag reads handle a read cut off by a disconnect differently. The Accounting page, the merchant rule vendor picker, and the category and tag pickers use them.

AI Tests

  • Formatting follow-up at 9c2f28b4: corrected the three files flagged by CI Oxfmt, with no behavior changes. Passed: full-repository formatting (rerun produced no further diff), 50 targeted tests across three suites, changed-file lint/spelling, all TypeScript projects, React Compiler for the changed hook, Storybook smoke test, and incremental code review. The initial typecheck timed out; the rerun passed. Full Jest and browser verification were not rerun for this formatting-only change.
  • December 2 main merge at 067c9a567e: merged main c2ffc46f27, resolving three conflicts and adapting the importer to main's policy-scoped rules fetching while preserving failure feedback, explicit retry, and safe refresh after an ambiguous import. Passed: 233 targeted tests across eight suites, merge-resolution lint/spelling, React Compiler, Storybook smoke test, and code review. Added coverage for scoped retry/isolation and superseding a pre-import snapshot. Full Jest exceeded its three-minute local limit without a completion summary. Typecheck is blocked by missing gesture-handler and Apple Wallet exports in the installed native dependencies; the reported source files match main unchanged, and no errors were reported in the resolved files. Standalone formatting was blocked by command permissions. No browser verification was performed. Earlier results below apply to their respective prior commits.
  • Main-merge verification at e6f0986fe0: merged main d48c6e4be6, resolving the single import conflict by retaining the PR's merchant-rule helpers and adopting main's duplicate-column helper rename. Passed: 145 targeted tests across seven suites, all TypeScript projects, resolved-file lint/spelling and React Compiler, Storybook smoke test, and incremental merge-resolution code review. The initial two-minute typecheck/test attempts timed out; reruns completed successfully. Full Jest timed out after ten minutes without a completion summary. Standalone formatting was blocked by command permissions; browser verification was not run. Earlier results below refer to the pre-merge implementation.
  • Unit tests pass for the converter, the import hook, the review page, the shared loaders and the import action. Lint, typecheck, spelling, React Compiler and formatting pass.
  • CI passes on 969684bd897.

Fixed Issues

$ #107578
PROPOSAL: #107578 (comment)

Tests

Prerequisite

  1. Use a workspace on the Control plan, with Rules turned on, connected to QuickBooks Online.
  2. In QuickBooks Online, go to Accounting > Rules and add these rules, keeping the first one above the second:
    • Money out, Description contains COFFEE CORNER, set a category (Category A)
    • Money out, Description contains COFFEE, set a different category (Category B)
    • Money in, Description contains STRIPE, set any category
  3. Select the arrow next to New rule, then Export rules, and save the file.

Test 1: Import QuickBooks Online rules

  1. Go to Workspaces > [workspace] > Rules and select More > Import QuickBooks Online rules. Verify the page explains how to export the rules, then select Next.
  2. Select Choose file and upload the exported file. Verify the page shows "We found 3 rules in your file.", "2 rules will be imported", "1 rule can't be imported", and How fields map shows Category as Categories.
  3. Select Import. Verify the message shows "2 rules imported." and "1 rule skipped. Expensify rules don't support its conditions or actions."
  4. Select Got it. Verify the Expense defaults tab lists the COFFEE CORNER and COFFEE rules.
  5. Create an expense in the workspace with merchant COFFEE CORNER 42. Verify its category is Category A.

Test 2: Import the same file again

  1. Repeat Test 1 steps 1 and 2. Verify the page shows "0 rules will be imported".
  2. Select Import. Verify the message shows "0 rules imported." and "2 rules already exist."

Test 3: Upload a file that isn't a QuickBooks Online export

  1. Repeat Test 1 step 1, then select Choose file and upload any other spreadsheet, such as a CSV. Verify Import failed says the file isn't a QuickBooks Online rules export. Select Close and verify you stay on the upload page.

Test 4: Workspace without QuickBooks Online

  1. In a workspace that isn't connected to QuickBooks Online, go to Rules > More. Verify Import merchant rules is listed and Import QuickBooks Online rules isn't.

Test 5: Collect workspace

  1. In a Collect workspace connected to QuickBooks Online, select Rules > More > Import QuickBooks Online rules. Verify the upgrade page opens, and after upgrading, the page from Test 1 step 1 opens.

Test 6: Import merchant rules still works

  1. In the prerequisite workspace, select Rules > More > Import merchant rules and upload a spreadsheet with one row: a merchant and a category.
  2. Map the columns to Merchant contains and Updated category, then select Import. Verify "1 merchant rule has been added."
  • Verify that no errors appear in the JS console

Offline tests

  1. If you already ran Tests, delete the COFFEE CORNER and COFFEE rules on the Expense defaults tab.
  2. Repeat Test 1 steps 1 and 2.
  3. Go offline. Verify the review page keeps the counts and Import is disabled.
  4. Go back online. Verify Import is enabled, then select it and verify "2 rules imported."

QA Steps

Same as tests

  • Verify that no errors appear in the JS console

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 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)
  • 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)
  • 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.
  • 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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@MelvinBot
MelvinBot requested a review from a team November 29, 2026 07:53
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Nov 29, 2026
@codecov

codecov Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONST/SENTRY_LABEL.ts 100.00% <ø> (ø)
src/CONST/index.ts 96.37% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/SCREENS.ts 100.00% <ø> (ø)
src/hooks/useHasSeenReadInFlight.ts 100.00% <100.00%> (ø)
src/hooks/useLoadPolicyCategories.ts 86.66% <100.00%> (+4.05%) ⬆️
src/hooks/useLoadPolicyTags.ts 97.91% <100.00%> (+0.35%) ⬆️
src/hooks/usePolicyConnectionsPrefetch.ts 100.00% <100.00%> (ø)
src/hooks/useRulesPrefetch.ts 96.66% <100.00%> (+1.66%) ⬆️
src/libs/ExportOnyxState/masking.ts 93.92% <ø> (ø)
... and 24 more
... and 7435 files with indirect coverage changes

@MelvinBot

MelvinBot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ❌ fail

Testing was blocked: the Android account shows “No workspaces yet,” and available tools could not provision the required QBO-connected Control workspace. PR build identity could not be independently confirmed; these results do not establish a feature failure.

Android Workspaces page showing No workspaces yet

Step Status
1. Import workbook; verify counts, icons, completion, and 14 rule mappingsBlocked: no workspace exists, so the import menu and feature behavior could not be verified.
Android Workspaces page showing No workspaces yet
❌
2. Verify UBER EATS → Meals and UBER TRIP → TravelBlocked: required workspace and imported rules unavailable.
❌
3. Reimport without adding duplicatesBlocked: initial import could not be performed.
❌
4. Verify Classes report-field omissions and warningBlocked: QBO connection, Classes configuration, and imported rules unavailable.
❌
5. Verify no JS console errorsUnverified: logging captured no data, and the requested import flow could not run.
❌

view run · view recording

@OSBotify

This comment has been minimized.

@MelvinBot

MelvinBot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ❌ fail

Blocked on dev NewDot web: the signed-in account shows “No workspaces yet,” so the required QBO-connected Control workspace is unavailable. No feature failure was established.

Workspaces page showing no workspaces available

Step Status
1. Import workbook; verify counts, icons, mappings, completion, and imported rulesBlocked: no workspace exists, and available tools cannot provision the required QBO fixture. Workbook uploads are also unsupported by the available web automation.
Workspaces page showing no workspaces available
❌
2. Verify UBER EATS 1234 → Meals and UBER TRIP → TravelBlocked: required workspace and imported rules unavailable; expense matching was not tested.
❌
3. Reimport without creating duplicate rulesBlocked: initial import could not be performed.
❌
4. Verify Classes report-field omissions and warningBlocked: no QBO-connected workspace is available for configuring Classes, syncing, or reimporting.
❌
5. Verify no JavaScript console errorsNot verified: the feature flow was blocked, and available web commands do not expose console inspection.
❌

view run · view recording

@TaduJR

This comment was marked as resolved.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Pushed 51138c3:

  • Removed the unused type export flagged by Knip.
  • Added file-scoped spelling exceptions for the workbook’s merchant names.

Passed: 55 targeted tests, lint, TypeScript, spelling, formatting, and Storybook smoke test. Full local Jest run timed out after 10 minutes.

CI is rerunning. Independent approval still requires human review.


view run

@TaduJR

This comment was marked as resolved.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Something went wrong. This may be a transient issue. Try again. If it persists, check status.openai.com.

Run details

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Something went wrong. This may be a transient issue. Try again. If it persists, check status.openai.com.

Run details

@MelvinBot
MelvinBot force-pushed the claude-importQuickBooksRules-TaduJR branch from 51138c3 to fa653f3 Compare November 29, 2026 08:52
@MelvinBot

MelvinBot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ❌ fail

Force-pushed to fa653f34c61, confirmed GitHub’s head matches exactly and git diff fa653f34c61 is empty; 95 targeted tests, lint, TypeScript and Storybook passed, but full Jest timed out and React Compiler reported an error. Web verification was blocked by an unavailable app session—not a confirmed feature failure.

App state blocking access to the required workspace

Step Status
Expense defaults exposes the QBO import entryBlocked: workspace inaccessible after retry.
App state blocking access to the required workspace
❌
Opening the entry shows import instructionsNot verified because the workspace was inaccessible.
❌

view run · no recording available

@OSBotify

This comment has been minimized.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Confirmed: the PR branch now points exactly to fa653f34c61, not merely an equivalent tree. GitHub and the remote branch both report that SHA. No further changes or push were needed.


view run

@github-actions github-actions Bot changed the title Import QuickBooks Online bank rules as merchant rules [No QA] Import QuickBooks Online bank rules as merchant rules Nov 29, 2026
@OSBotify

This comment has been minimized.

@TaduJR

This comment was marked as resolved.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Pushed both commits:

  • 12b618d2: removed the two unused type exports.
  • cbc6f99e: applied the full Polyglot Parrot diff.

Local checks deferred to CI as requested; commit-hook formatting passed.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Knip failed because two internal types were unnecessarily exported. While I tested the fix, the identical change landed in 12b618d, so no additional push was needed.

Knip now passes. Local verification passed 74 targeted tests, lint, TypeScript, spelling, formatting, and Storybook. Full local Jest timed out.

The only remaining failure is independent approval, which requires human review.


view run

@OSBotify

This comment has been minimized.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Something went wrong. This may be a transient issue. Try again. If it persists, check status.openai.com.

Run details

@TaduJR

TaduJR commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot Please replace the PR description with the below one

Also change the PR title to feat: Import QuickBooks Online bank rules as merchant rules

Description

Explanation of Change

Admins moving card spend from QuickBooks Online bank feeds had to re-create their bank rules in Expensify by hand. QuickBooks Online has no API for bank rules, but it can export them to a file. This PR lets a workspace connected to QuickBooks Online import that file as merchant rules, without mapping any columns.

The import is under Rules > More > Import QuickBooks Online rules, and only shows when the workspace is connected to QuickBooks Online. Collect workspaces go to the upgrade flow first, the same as New rule.

  1. An instructions page explains how to export the rules from QuickBooks Online.
  2. On the upload page, a file that isn't a QuickBooks Online rules export is rejected.
  3. A review page shows how many rules the file has, how many will be imported, how many can't be, and where each QuickBooks Online field goes.
  4. After Import, a summary lists what was imported, skipped, imported without some settings, or already existed.

A QuickBooks Online rule is imported only when the merchant rule it becomes matches no expense the original wouldn't, and sets nothing the original doesn't:

  • "Contains" and "Is exactly" become merchant conditions. A rule that matches any of its conditions becomes one merchant rule per text condition.
  • Money-in rules, "Doesn't contain" conditions, split and exclude rules are skipped. So are "all" rules that also check an amount or a second text.
  • Category, payee (as vendor), memo (as description), and class, customer and location (as tags) are set only when the value exists in the workspace. The summary says when a class, customer or location can't be set because the workspace imports it as a report field.
  • Rules already in the workspace, and repeats within the file, are skipped.
  • Rules are sent so the higher rule in the file wins any field both rules set, as in QuickBooks Online. A lower rule can still add a field the higher one doesn't set, because Expensify applies every matching rule. This was accepted for this PR.

The review page counts the rules only after the workspace's categories, tags, existing rules and QuickBooks Online data have fully loaded. If one of them fails to load, it shows an error with Try again. Offline, it only shows counts when that data was fully loaded earlier in the session.

No backend change is needed: the rules go through the existing ImportMerchantRulesSpreadsheet command. The spreadsheet merchant rules importer and ImportSpreadsheet now share code with this import, so both need a regression check.

Fixed Issues

$ #107578
PROPOSAL: #107578 (comment)

Tests

Prerequisite

  1. Use a workspace on the Control plan, with Rules turned on, connected to QuickBooks Online.
  2. In QuickBooks Online, go to Accounting > Rules and add these rules, keeping the first one above the second:
    • Money out, Description contains COFFEE CORNER, set a category (Category A)
    • Money out, Description contains COFFEE, set a different category (Category B)
    • Money in, Description contains STRIPE, set any category
  3. Select the arrow next to New rule, then Export rules, and save the file.

Test 1: Import QuickBooks Online rules

  1. In Expensify, go to Workspaces > [workspace] > Rules and select More > Import QuickBooks Online rules. Verify the page explains how to export the rules, then select Next.
  2. Select Choose file and upload the exported file. Verify the page shows "We found 3 rules in your file.", "2 rules will be imported", "1 rule can't be imported", and a How fields map list.
  3. Select Import. Verify the message shows "2 rules imported." and "1 rule skipped. Expensify rules don't support its conditions or actions."
  4. Select Got it. Verify the Expense defaults tab lists Merchant contains "COFFEE CORNER" and Merchant contains "COFFEE".
  5. Create an expense in the workspace with merchant COFFEE CORNER 42. Verify its category is Category A.

Test 2: Upload a file that isn't a QuickBooks Online export

  1. Go to Rules, select More > Import QuickBooks Online rules, then select Next.
  2. Select Choose file and upload any other spreadsheet, such as a CSV. Verify Import failed says the file isn't a QuickBooks Online rules export, and you stay on the upload page after selecting Close.

Test 3: Import the same file again

  1. After Test 1, repeat Test 1 steps 1 and 2. Verify the page shows "0 rules will be imported".
  2. Select Import. Verify the message shows "0 rules imported." and "2 rules already exist."

Test 4: Workspace without QuickBooks Online

  1. In a workspace that isn't connected to QuickBooks Online, go to Rules > More. Verify Import QuickBooks Online rules isn't listed.

Test 5: Collect workspace

  1. In a Collect workspace connected to QuickBooks Online, select More > Import QuickBooks Online rules. Verify the upgrade page opens, and after upgrading, the instructions page from Test 1 step 1 opens.

Test 6: Import merchant rules still works

  1. In the setup workspace, select More > Import merchant rules and upload a spreadsheet with one row: a merchant and a category.
  2. Map the columns to Merchant contains and Updated category, then select Import. Verify "1 merchant rule has been added."
  • Verify that no errors appear in the JS console

Offline tests

Same as tests

QA Steps

Same as tests

  • Verify that no errors appear in the JS console

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 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)
  • 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)
  • 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.
  • 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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@TaduJR

TaduJR commented Nov 29, 2026 •

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 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)
  • 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)
  • 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.
  • 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 01-more-menu-collect 02-instructions 03-upload 04-invalid-file 05-review 06-completion-modal 07-expense-defaults 08-reimport-duplicates 09-regression-mapping

@TaduJR

TaduJR commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 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-30T06:11:53.303064Z 969684b Draft marked ready
ℹ️ 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 changed the title [No QA] Import QuickBooks Online bank rules as merchant rules feat: Import QuickBooks Online bank rules as merchant rules Nov 29, 2026

@TaduJR TaduJR 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.

LGTM!

@TaduJR

TaduJR commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot

Please remove the No-QA from the title

@MelvinBot MelvinBot changed the title [No QA] Import QuickBooks Online bank rules as merchant rules Import QuickBooks Online bank rules as merchant rules Dec 1, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Removed [No QA] from the PR title.


view run

@TaduJR

TaduJR commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@TaduJR There are some conflicts and the bot also left some suggestions

@pecanoro

The suggestions are invalid.

@TaduJR

TaduJR commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@twisterdotcom

Could you confirm these #108272 (comment) before CME review.

Thanks!

@TaduJR

TaduJR commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Left some changes for follow-ups, because they also happen on main and need shared changes/DRY

@pecanoro pecanoro 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.

These comments come from a review I ran with Claude.

}
isMoneyOutRule = true;
break;
case RULE_TYPE.DOES_NOT_CONTAIN:

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.

For an Any rule, can we drop the "Doesn't contain" condition instead of skipping the whole rule? Dropping it is as safe as dropping an amount condition. For example, contains HILTON or doesn't contain REFUND could still import as contains HILTON.

goBackToImportedMerchantRules(policyID);
};

const importRules = async () => {

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.

A fast double tap on Import can send the request twice, which creates every rule twice. Can we add shouldShowLoadingImmediatelyOnPress to the button to block the second tap?

Comment thread src/libs/actions/Policy/Rules.ts Outdated
}

// The server may have saved the rules, so they're read again, and one write marks that read in flight (offline nothing is sent) so no other screen sends its own
Onyx.multiSet({[ONYXKEYS.RAM_ONLY_HAS_RULES_DATA_BEEN_FETCHED]: false, [ONYXKEYS.RAM_ONLY_IS_LOADING_RULES]: !getIsOffline()});

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.

When an import fails, this reloads every rule from the server, and that reload replaces the rules stored on the device. A rule showing an error, from an earlier save that failed, would lose its error. Can we reload only when the request got no response, since that's the only case where the server might have saved the rules?

const hasSeenReadInFlight = useHasSeenReadInFlight(policyID, isLoading);

// A read whose request threw stays loading for good, so a retry sends it whether or not one looks in flight
const retryLoadPolicyVendors = () => {

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.

This hook copies the loading and retry logic of useLoadPolicyCategories and useLoadPolicyTags, and usePolicyConnectionsPrefetch repeats the same failure check. Can we move it into one shared hook?

@stephanieelliott stephanieelliott added the HelpDot Apply this label if the issue relates to ExpensifyHelp label Dec 2, 2026
@TaduJR

TaduJR commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot

Please merge main

Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Merged main and pushed 067c9a567e, resolving all three conflicts. GitHub reports no remaining merge conflicts.

233 targeted tests passed. Typecheck hit native dependency errors; full Jest timed out, and formatting verification was blocked by command permissions.


view run

@github-actions github-actions Bot changed the title Import QuickBooks Online bank rules as merchant rules [No QA] Import QuickBooks Online bank rules as merchant rules Dec 2, 2026
@OSBotify

This comment has been minimized.

Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Pushed 9c2f28b4, fixing Oxfmt formatting in the three flagged files. No behavior changes.

Passed: formatting, 50 targeted tests, lint, TypeScript, spelling, React Compiler, and Storybook smoke test. CI is rerunning. Independent approval still requires human review.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Something went wrong. This may be a transient issue. Try again. If it persists, check status.openai.com.

Run details

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Something went wrong. This may be a transient issue. Try again. If it persists, check status.openai.com.

Run details

@OSBotify

OSBotify commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

@heyjennahay
heyjennahay removed their request for review December 3, 2026 15:32
@TaduJR

TaduJR commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot

Please merge main

TaduJR commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Resolved the two merge conflicts locally; 93 targeted tests, lint, typecheck, and Storybook smoke tests passed.

I couldn’t push: the publishing tool doesn’t support merge commits. The PR is unchanged and needs main merged manually.


view run

@pecanoro

pecanoro commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

New conflicts 😞

@twisterdotcom

Copy link
Copy Markdown
Contributor

#108272 (comment)

This all seems fine @TaduJR.

the test file on this issue was generated rather than exported from QuickBooks Online, and the rule codes aren't documented anywhere. Could someone with a QuickBooks Online company export a few real bank rules and attach the file? Ideally one with a Description condition and one with a Bank text condition, so I can confirm the codes match.

Sure, I'll do this.

@twisterdotcom

Copy link
Copy Markdown
Contributor

@TaduJR here's a real bank rules export from a QuickBooks Online test company (16 rules). It includes Bank text conditions with Contains, Is exactly and Doesn't contain, plus Amount conditions, an Any/OR rule, a split rule, and rules scoped to a single account.

The format matches the test file on the issue (QBO_Rules_Test_Import.xls): same three columns and the same ruleType/actionType codes.

On the Description vs Bank text question: the export doesn't record which field a text condition checks. It only has the match type (6 contains, 13 is exactly, 8 doesn't contain), and the current QBO editor only offers "Bank text" and "Amount." So there's no separate Description code to handle.

Expensify__Inc__Test_Bank_Feed_Rules (6).xls

@TaduJR

TaduJR commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot Please make this branch match fork's 2393e22f50f exactly. It's one commit on main's d3daeb0fc30, so it has no merge commits and resolves the conflicts. It includes the four review changes and the latest main.

git fetch https://github.com/TaduJR/App.git fix-Import-QuickBooks-Online-bank-rules-as-merchant-rules
git reset --hard 2393e22f50f177479ec892dfc9cbff4464e79fc7
git push --force-with-lease

Don't add anything on top, don't change the PR description, and skip local checks. CI will run them. If you can't force-push, stop and tell me instead of committing on top.

@melvin-bot

melvin-bot Bot commented Dec 4, 2026

Copy link
Copy Markdown

I can’t force-push an existing commit with the available publishing tool; it only publishes new commits. I stopped without changing the branch or PR description, adding commits, or running local checks.

@TaduJR

TaduJR commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Closing this PR and re-raising a new one since Melvin got updated and we need to continue on a new PR inorder for him to work

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

Labels

HelpDot Apply this label if the issue relates to ExpensifyHelp Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants