Skip to content

fix: Pay with Expensify-Cancel payment option is not displayed for the paid expense#69731

Merged
chiragsalian merged 5 commits intoExpensify:mainfrom
TaduJR:fix-Pay-with-Expensify-Cancel-payment-option-is-not-displayed-for-the-paid-expense
Dec 22, 2025
Merged

fix: Pay with Expensify-Cancel payment option is not displayed for the paid expense#69731
chiragsalian merged 5 commits intoExpensify:mainfrom
TaduJR:fix-Pay-with-Expensify-Cancel-payment-option-is-not-displayed-for-the-paid-expense

Conversation

@TaduJR
Copy link
Copy Markdown
Contributor

@TaduJR TaduJR commented Sep 3, 2025

Explanation of Change

The cancel payment button was not displaying for bank payments because pay actions were being fetched per-transaction using getIOUActionForReportID, but pay actions are actually stored at the report level, not per transaction. This resulted in an empty payActions array, causing the cancel button logic to fail.

Key changes:

  1. Fixed pay actions retrieval: Changed from per-transaction lookup to fetching all report actions at the report level using getAllReportActions(report.reportID), then filtering for pay actions.

  2. Added payment type detection: Introduced isPaidViaBankAccount to distinguish between bank payments (VBBA/ACH) and manual payments (ELSEWHERE). Uses type narrowing with 'paymentType' in originalMessage for
    TypeScript safety.

  3. Added bank processing state detection: Added isBankProcessing check that handles both:

    • BILLING state (stateNum: 3) - when ACH batch has been submitted
    • APPROVED + REIMBURSED state - immediately after paying via bank, before batch is sent
  4. Fixed NACHA cutoff operator: Changed from < to > so hasDailyNachaCutoffPassed correctly returns true when the current time is after the 23:45 UTC cutoff.

Result:

  • For bank payments: Cancel button shows while payment is processing (before NACHA cutoff)
  • For "paid elsewhere" payments: Cancel button shows immediately (no cutoff restriction)
  • Cancel button hides after payment is cancelled or after NACHA cutoff passes

Fixed Issues

$ #66225
PROPOSAL: #66225 (comment)

Tests

Action Performed:
Preconditions: 1- Admin of a workspace with the business bank account added. 2 - Member of the workspace, has a personal bank account.

  1. As a Member, submit a manual expense to the workspace chat on a US workspace
  2. As the Admin, approve the expense and pay with Expensify
  3. As the Admin, navigate to the paid expense details, open "More" menu
  4. Verify that "Cancel payment" is presented to the Admin after paying the expense with Expensify. The admin should be able to cancel the reimbursement up until we send the credit to our sponsor bank for processing.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."
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
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • 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.

Screenshots/Videos

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

@TaduJR TaduJR requested review from a team as code owners September 3, 2025 07:18
@melvin-bot melvin-bot bot requested review from suneox and removed request for a team September 3, 2025 07:19
@melvin-bot
Copy link
Copy Markdown

melvin-bot bot commented Sep 3, 2025

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

@joekaufmanexpensify
Copy link
Copy Markdown
Contributor

Let's test this with an adhoc build before merging. Please let me know when it's ready do that and I'll spin one up 👍

@suneox
Copy link
Copy Markdown
Contributor

suneox commented Sep 3, 2025

Overall, the change set looks good. Since most contributors don’t have a business bank account so we'll test with mock data.
@chiragsalian, could you please help trigger an ad-hoc build to verify with real data? Thank you!

cc: @mitarachim

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 3, 2025

🚧 @chiragsalian has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@suneox
Copy link
Copy Markdown
Contributor

suneox commented Sep 3, 2025

🚧 @chiragsalian has triggered a test Expensify/App build. You can view the workflow run here.

Thank you!

@TaduJR We can start creating mock data to complete the PR checklist

@joekaufmanexpensify
Copy link
Copy Markdown
Contributor

joekaufmanexpensify commented Sep 3, 2025

Hmm, I tested on the ad-hoc build and am not seeing the option to cancel immediately after paying. @TaduJR @suneox

2025-09-03_16-36-09.mp4

@suneox
Copy link
Copy Markdown
Contributor

suneox commented Sep 4, 2025

Hmm, I tested on the ad-hoc build and am not seeing the option to cancel immediately after paying. @TaduJR @suneox

We will proceed with testing using mock data. There may be another condition blocking this flow

@joekaufmanexpensify
Copy link
Copy Markdown
Contributor

We will proceed with testing using mock data. There may be another condition blocking this flow

Got it. Please let me know once it is ready to retest. We should make sure it works on the ad-hoc build, or figure out what the other condition is, if there is one.

@suneox
Copy link
Copy Markdown
Contributor

suneox commented Sep 8, 2025

We will proceed with testing using mock data. There may be another condition blocking this flow

@TaduJR how about your test, do you think there might be any other condition blocking this flow?

@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented Sep 9, 2025

@suneox Investigating

@trjExpensify
Copy link
Copy Markdown
Contributor

A migrated user brought this up to @twisterdotcom today. Can we keep this moving to get this fixed? Thanks!

@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented Sep 10, 2025

@suneox After investigating the complete isCancelPaymentAction logic, I believe the issue in the ad-hoc build is likely one of these blocking conditions:

1. isPayer Check Failing

The isPayer function has complex logic around:

  • ACH account reimburser settings
  • Policy reimbursement configuration (REIMBURSEMENT_YES vs REIMBURSEMENT_MANUAL)
  • User roles and permissions

In test environments, the user might not be properly configured as the designated reimburser for the test bank account.

2. isPaymentProcessing Check Failing

This requires both:

  • report.isWaitingOnBankAccount === true
  • report.statusNum === CONST.REPORT.STATUS_NUM.APPROVED

Test payments might not trigger the proper isWaitingOnBankAccount state.

Extensive Debugging Steps:

  1. Add console logs to verify which condition is failing:
function isCancelPaymentAction(report: Report, reportTransactions: Transaction[], policy?: Policy): boolean {
     const isExpenseReport = isExpenseReportUtils(report);

     if (!isExpenseReport) {
         return false;
     }

     const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
     const session = getSession();  // Store in variable first
     const isPayer = isPayerUtils(session, report, false, policy);

     // Log with already computed values, not function calls
     console.log('🔍 Cancel Payment Debug - Initial checks:', {
         reportID: report.reportID,
         isExpenseReport,
         isAdmin,
         isPayer,
         policyRole: policy?.role,
         userAccountID: session?.accountID,  // Use stored variable
         userEmail: session?.email,           // Use stored variable
         managerID: report.managerID,
     });

     if (!isAdmin || !isPayer) {
         console.log('❌ Cancel Payment - Failed admin/payer check:', { isAdmin, isPayer });
         return false;
     }

     const isReportPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;

     if (isReportPaidElsewhere) {
         console.log('✅ Cancel Payment - Paid elsewhere, showing button');
         return true;
     }

     const isPaymentProcessing = !!report.isWaitingOnBankAccount && report.statusNum === CONST.REPORT.STATUS_NUM.APPROVED;

     console.log('🔍 Cancel Payment - Payment state:', {
         isPaymentProcessing,
         isWaitingOnBankAccount: report.isWaitingOnBankAccount,
         statusNum: report.statusNum,
         expectedStatus: CONST.REPORT.STATUS_NUM.APPROVED,
     });

     const payActions = reportTransactions.reduce((acc, transaction) => {
         const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
         if (action && isPayAction(action)) {
             acc.push(action);
         }
         return acc;
     }, [] as ReportAction[]);

     console.log('🔍 Cancel Payment - Pay actions found:', payActions.length);

     const hasDailyNachaCutoffPassed = payActions.some((action) => {
         const now = new Date();
         const paymentDatetime = new Date(action.created);
         const nowUTC = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds()));
         const cutoffTimeUTC = new Date(Date.UTC(paymentDatetime.getUTCFullYear(), paymentDatetime.getUTCMonth(), paymentDatetime.getUTCDate(), 23, 45, 0));

         const cutoffPassed = nowUTC.getTime() > cutoffTimeUTC.getTime();

         console.log('🔍 NACHA cutoff check:', {
             actionCreated: action.created,
             nowUTC: nowUTC.toISOString(),
             cutoffTimeUTC: cutoffTimeUTC.toISOString(),
             cutoffPassed,
         });

         return cutoffPassed;
     });

     const finalResult = isPaymentProcessing && !hasDailyNachaCutoffPassed;

     console.log('🎯 Cancel Payment - Final decision:', {
         isPaymentProcessing,
         hasDailyNachaCutoffPassed,
         finalResult,
         willShowButton: finalResult
     });

     return finalResult;
 }

This will log all the key conditions so you can see exactly which one is failing in the ad-hoc build testing.

@joekaufmanexpensify Could you please add the above loggers, and give us the result? Thank you 🙏

@joekaufmanexpensify
Copy link
Copy Markdown
Contributor

@TaduJR Just to make sure I am following, I should run that function in my console after paying a report when we expect the cancel payment button to appear, but when it is not?

@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented Sep 10, 2025

@joekaufmanexpensify If possible in order to get more insights both would be great, but the main one is running after paying a report when we expect the cancel payment button to appear

@joekaufmanexpensify
Copy link
Copy Markdown
Contributor

Discussing to make sure I can run this before I do.

@joekaufmanexpensify
Copy link
Copy Markdown
Contributor

@TaduJR @suneox I chatted with our internal engineering team and they advised this logging function won't work because it's attempting to call functions not available in the console. How else we can we debug the issue?

@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented Sep 12, 2025

@joekaufmanexpensify

they advised this logging function won't work because it's attempting to call functions not available in the console.

I've updated the debugging code to store values in variables first before logging them so it uses all console.log statements only use already-computed values.

@joekaufmanexpensify
Copy link
Copy Markdown
Contributor

Checking again internally

@joekaufmanexpensify
Copy link
Copy Markdown
Contributor

@TaduJR I chatted with some colleages again, they recommended you temporarily commit this updated version of the function with the logging, and then I can spin up another adhoc build and test with it. Sound good?

@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented Sep 15, 2025

I’m very sorry for the inconvenience @joekaufmanexpensify, but I’m currently unwell with a high fever and flu and haven’t been able to make progress on this PR despite my efforts. I’ll do my best to catch up and complete the work as soon as I’m able. Thank you for your understanding, and I apologize again for the delay.

@joekaufmanexpensify
Copy link
Copy Markdown
Contributor

Thanks for the update, hope you feel better soon!

@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented Sep 16, 2025

@joekaufmanexpensify Made the temporary commit

@github-actions
Copy link
Copy Markdown
Contributor

🚧 @joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions
Copy link
Copy Markdown
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
Built from App PR #69731.

Android 🤖 iOS 🍎
https://ad-hoc-expensify-cash.s3.amazonaws.com/android/69731/index.html https://ad-hoc-expensify-cash.s3.amazonaws.com/ios/69731/index.html
Android iOS
Desktop 💻 Web 🕸️
https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/69731/NewExpensify.dmg https://69731.pr-testing.expensify.com
Desktop Web

👀 View the workflow run that generated this build 👀

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 9, 2025

🚧 @joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 9, 2025

🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
Built from App PR #69731.

Android 🤖 iOS 🍎
⏩ SKIPPED ⏩ ⏩ SKIPPED ⏩
The build for Android was skipped The build for iOS was skipped
Desktop 💻 Web 🕸️
⏩ SKIPPED ⏩ https://69731.pr-testing.expensify.com
The build for Desktop was skipped Web

👀 View the workflow run that generated this build 👀

@github-actions
Copy link
Copy Markdown
Contributor

🚧 @joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions
Copy link
Copy Markdown
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
Built from App PR #69731.

Android 🤖 iOS 🍎
⏩ SKIPPED ⏩ ⏩ SKIPPED ⏩
The build for Android was skipped The build for iOS was skipped
Desktop 💻 Web 🕸️
⏩ SKIPPED ⏩ https://69731.pr-testing.expensify.com
The build for Desktop was skipped Web

👀 View the workflow run that generated this build 👀

@github-actions
Copy link
Copy Markdown
Contributor

🚧 @joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions
Copy link
Copy Markdown
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
Built from App PR #69731.

Android 🤖 iOS 🍎
⏩ SKIPPED ⏩ ⏩ SKIPPED ⏩
The build for Android was skipped The build for iOS was skipped
Desktop 💻 Web 🕸️
⏩ SKIPPED ⏩ https://69731.pr-testing.expensify.com
The build for Desktop was skipped Web

👀 View the workflow run that generated this build 👀

@TaduJR TaduJR force-pushed the fix-Pay-with-Expensify-Cancel-payment-option-is-not-displayed-for-the-paid-expense branch from e11ba5a to 3c01bf0 Compare December 11, 2025 04:44
@github-actions
Copy link
Copy Markdown
Contributor

🚧 @joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions
Copy link
Copy Markdown
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
Built from App PR #69731.

Android 🤖 iOS 🍎
⏩ SKIPPED ⏩ ⏩ SKIPPED ⏩
The build for Android was skipped The build for iOS was skipped
Desktop 💻 Web 🕸️
⏩ SKIPPED ⏩ https://69731.pr-testing.expensify.com
The build for Desktop was skipped Web

👀 View the workflow run that generated this build 👀

@TaduJR TaduJR force-pushed the fix-Pay-with-Expensify-Cancel-payment-option-is-not-displayed-for-the-paid-expense branch from e39cea2 to a0af1ca Compare December 17, 2025 17:31
@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented Dec 17, 2025

Hey @suneox
We can proceed with the review!

Thanks!

@suneox
Copy link
Copy Markdown
Contributor

suneox commented Dec 18, 2025

Hey @suneox We can proceed with the review!

Thanks!

From my previous review, the current logic change getting payActions from the existing util and updating isBankProcessing with isApprovedAndReimbursed still makes sense to me.

I’m just curious whether we should also check the final case where STATE_NUM = AUTOREIMBURSED.
However, since the production team has already verified adhoc build, I consider it a nice-to-have so I’ll proceed with the checklist for the another cancel flows.

…h-Expensify-Cancel-payment-option-is-not-displayed-for-the-paid-expense
  - Added AUTOREIMBURSED (stateNum: 6) state check for bank processing
  - Added STATUS_NUM.REIMBURSED check to isInBillingState for consistency
@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented Dec 19, 2025

@suneox

I’m just curious whether we should also check the final case where STATE_NUM = AUTOREIMBURSED.
However, since the production team has already verified adhoc build, I consider it a nice-to-have so I’ll proceed with the checklist for the another cancel flows.

Added that also

@suneox
Copy link
Copy Markdown
Contributor

suneox commented Dec 21, 2025

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 there are no new alerts related to the canBeMissing param for useOnyx
  • 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
CleanShot.2025-12-21.at.22.28.06__2.mp4
Android: mWeb Chrome
CleanShot.2025-12-21.at.22.30.18__2.mp4
iOS: HybridApp
CleanShot.2025-12-21.at.22.23.19__2.mp4
iOS: mWeb Safari
CleanShot.2025-12-21.at.22.24.25__2.mp4
MacOS: Chrome / Safari

Enable approval

CleanShot.2025-12-21.at.22.20.23__2.mp4

Disable approval

CleanShot.2025-12-21.at.22.17.54__2.mp4

Copy link
Copy Markdown
Contributor

@suneox suneox left a comment

Choose a reason for hiding this comment

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

Currently, the NACHA cutoff logic is not available for test bank accounts. I’ve verified the normal flow with approval enabled/disabled and auto-submission. The change LGTM

@melvin-bot melvin-bot bot requested a review from chiragsalian December 21, 2025 15:48
Copy link
Copy Markdown
Contributor

@chiragsalian chiragsalian left a comment

Choose a reason for hiding this comment

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

LGTM

@chiragsalian chiragsalian merged commit 49166aa into Expensify:main Dec 22, 2025
30 checks passed
@OSBotify
Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/chiragsalian in version: 9.2.86-0 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 failure ❌
🍎 iOS 🍎 success ✅

@OSBotify
Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.2.86-4 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@TaduJR TaduJR deleted the fix-Pay-with-Expensify-Cancel-payment-option-is-not-displayed-for-the-paid-expense branch December 31, 2025 14:10
violations: {},
policy,
});
expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CANCEL_PAYMENT)).toBe(true);
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.

The unit tests added in this PR caused regression of flaky tests.
#78620
#79268

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hey @situchan

Thanks for the notice!

We already discussed with arosiclair yesterday on slack. Prepared a PR raising it.

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.

8 participants