You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD] [$250] Workflows - Report is not auto-paid despite enabled feature #82995
Version Number: v9.3.23-2 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://github.com/Expensify/Mobile-Expensify/pull/13848 Email or phone of affected tester (no customers): - Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: MacOS Monterey 12.7.4 / Chrome App Component: Other
Action Performed:
Preconditions: control workspace with invited member. Enable Settings > Workspaces > {workspace} > Workflows > Auto-pay approved reports
STR:
Member: Submit an expense in the workspace chat (amount is under auto-pay limit)
Please re-state the problem that we are trying to solve in this issue.
When "Auto-pay approved reports" is enabled on a Control workspace (Settings > Workspaces > Workflows), and a member submits an expense that is under the auto-pay limit, the report is not automatically paid after the admin approves it. The admin must manually pay the report despite auto-pay being enabled.
What is the root cause of that problem?
After thorough investigation of the frontend codebase, the auto-payment after approval is entirely handled by the backend. The frontend's approveMoneyRequest function (src/libs/actions/IOU/index.ts:10500-10851) sends an ApproveMoneyRequest API command to the backend with only the reportID and approvedReportActionID — it does not pass any auto-reimbursement settings, payment method, or bank account information. The ApproveMoneyRequestParams type (src/libs/API/parameters/ApproveMoneyRequestParams.ts) confirms there are zero auto-pay related fields.
The backend is solely responsible for:
Receiving the approval command
Checking the policy's auto-reimbursement settings (autoReimbursement.limit, reimbursementChoice, etc.)
Deciding whether to trigger automatic payment
This means the root cause is server-side — the backend's ApproveMoneyRequest handler is not properly triggering auto-reimbursement after approval.
If reimbursementChoice === REIMBURSEMENT_YES: returns false directly
If reimbursementChoice !== REIMBURSEMENT_YES: canBeAutoReimbursed() also returns false (because it requiresREIMBURSEMENT_YES internally at ReportUtils.ts:10854)
This means the "Pay" button always shows for approved reports even when auto-pay should handle payment — a symptom consistent with the bug report.
What changes do you think we should make in order to solve the problem?
Since the actual auto-payment trigger is server-side, this requires a backend investigation of the ApproveMoneyRequest command handler to understand why it's not initiating auto-reimbursement after approval.
policy.autoReimbursement.limit >= reportTotal (report is under the auto-pay limit)
policy.shouldShowAutoReimbursementLimitOption === true (auto-pay toggle is enabled)
policy.achAccount.bankAccountID exists (bank account is connected)
Report currency is in the supported list (USD, AUD, CAD, GBP, EUR)
Additionally, the dead code at IOU/index.ts:10404 should be fixed. The ternary should be removed so canBeAutoReimbursed is called directly, allowing the Pay button to be hidden when auto-reimbursement is expected:
However, the canBeAutoReimbursed function also needs a check for shouldShowAutoReimbursementLimitOption to respect the toggle state, since currently it only checks reimbursementChoice and autoReimbursement.limit.
What alternative solutions did you explore? (Optional)
Investigated whether this was a frontend regression — checked recent commits to IOU/index.ts, ReportUtils.ts, Policy.ts, and ExpenseReportRulesSection.tsx. No recent frontend changes modify the auto-pay flow. The enablePolicyAutoReimbursementLimit function correctly sends the EnablePolicyAutoReimbursementLimit API command with the toggle state, and setPolicyAutoReimbursementLimit correctly sends the limit. The issue is that after approval, the backend doesn't act on these settings.
Detailed Investigation
How Auto-Pay Settings Are Configured
Toggle: enablePolicyAutoReimbursementLimit(policyID, true) at Policy.ts:6596-6663 sends EnablePolicyAutoReimbursementLimit with {policyID, enabled} to backend
Limit: setPolicyAutoReimbursementLimit(policyID, limit) at Policy.ts:6523-6587 sends SetPolicyAutoReimbursementLimit with {policyID, limit}
The approveMoneyRequest function sends APPROVE_MONEY_REQUEST to the backend. The params contain no auto-pay info — the backend must independently check the policy's settings and decide whether to auto-reimburse.
Dead Code Analysis
At IOU/index.ts:10404, the isAutoReimbursable variable in canIOUBePaid is always false due to contradictory logic between the ternary and canBeAutoReimbursed(). This is used on line 10425 (!isAutoReimbursable) to determine whether to show the Pay button — since it's always false, the Pay button always shows.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR for the frontend fix (dead code in canIOUBePaid), or @MelvinBot <your feedback> to refine this analysis. Note that the core issue (auto-pay not triggering) requires a backend investigation of the ApproveMoneyRequest handler.
changed the title [-]Workflows - Report is not auto-paid despite enabled feature[/-][+][$250] Workflows - Report is not auto-paid despite enabled feature[/+]on Feb 19, 2026
@m-natarajan From the logs I see that both payer and submitter are using same bank account. You can't pay yourself when credit and debit bank accounts are the same. If you change the bank account of the submitter or just remove it, you will see that the payment will be initiated automatically.
Activity
melvin-bot commentedon Feb 19, 2026
Triggered auto assignment to @joekaufmanexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.MelvinBot commentedon Feb 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When "Auto-pay approved reports" is enabled on a Control workspace (Settings > Workspaces > Workflows), and a member submits an expense that is under the auto-pay limit, the report is not automatically paid after the admin approves it. The admin must manually pay the report despite auto-pay being enabled.
What is the root cause of that problem?
After thorough investigation of the frontend codebase, the auto-payment after approval is entirely handled by the backend. The frontend's
approveMoneyRequestfunction (src/libs/actions/IOU/index.ts:10500-10851) sends anApproveMoneyRequestAPI command to the backend with only thereportIDandapprovedReportActionID— it does not pass any auto-reimbursement settings, payment method, or bank account information. TheApproveMoneyRequestParamstype (src/libs/API/parameters/ApproveMoneyRequestParams.ts) confirms there are zero auto-pay related fields.The backend is solely responsible for:
autoReimbursement.limit,reimbursementChoice, etc.)This means the root cause is server-side — the backend's
ApproveMoneyRequesthandler is not properly triggering auto-reimbursement after approval.There is also a related frontend UI issue at
src/libs/actions/IOU/index.ts:10404whereisAutoReimbursablecontains dead code logic:This is always
falsebecause:reimbursementChoice === REIMBURSEMENT_YES: returnsfalsedirectlyreimbursementChoice !== REIMBURSEMENT_YES:canBeAutoReimbursed()also returnsfalse(because it requiresREIMBURSEMENT_YESinternally atReportUtils.ts:10854)This means the "Pay" button always shows for approved reports even when auto-pay should handle payment — a symptom consistent with the bug report.
What changes do you think we should make in order to solve the problem?
Since the actual auto-payment trigger is server-side, this requires a backend investigation of the
ApproveMoneyRequestcommand handler to understand why it's not initiating auto-reimbursement after approval.The backend should be checking:
policy.reimbursementChoice === 'reimburseYes'(Direct reimbursement)policy.autoReimbursement.limit >= reportTotal(report is under the auto-pay limit)policy.shouldShowAutoReimbursementLimitOption === true(auto-pay toggle is enabled)policy.achAccount.bankAccountIDexists (bank account is connected)Additionally, the dead code at
IOU/index.ts:10404should be fixed. The ternary should be removed socanBeAutoReimbursedis called directly, allowing the Pay button to be hidden when auto-reimbursement is expected:However, the
canBeAutoReimbursedfunction also needs a check forshouldShowAutoReimbursementLimitOptionto respect the toggle state, since currently it only checksreimbursementChoiceandautoReimbursement.limit.What alternative solutions did you explore? (Optional)
Investigated whether this was a frontend regression — checked recent commits to
IOU/index.ts,ReportUtils.ts,Policy.ts, andExpenseReportRulesSection.tsx. No recent frontend changes modify the auto-pay flow. TheenablePolicyAutoReimbursementLimitfunction correctly sends theEnablePolicyAutoReimbursementLimitAPI command with the toggle state, andsetPolicyAutoReimbursementLimitcorrectly sends the limit. The issue is that after approval, the backend doesn't act on these settings.Detailed Investigation
How Auto-Pay Settings Are Configured
enablePolicyAutoReimbursementLimit(policyID, true)atPolicy.ts:6596-6663sendsEnablePolicyAutoReimbursementLimitwith{policyID, enabled}to backendsetPolicyAutoReimbursementLimit(policyID, limit)atPolicy.ts:6523-6587sendsSetPolicyAutoReimbursementLimitwith{policyID, limit}ExpenseReportRulesSection.tsx:27-28):policy.areWorkflowsEnabledmust be truepolicy.reimbursementChoicemust be'reimburseYes'(Direct)policy.achAccount.bankAccountIDmust existPolicy Data Model
shouldShowAutoReimbursementLimitOptionautoReimbursement.limitautoReimbursementLimitreimbursementChoice'reimburseYes'(Direct) /'reimburseNo'(None) /'reimburseManual'(Indirect)Approval Flow
The
approveMoneyRequestfunction sendsAPPROVE_MONEY_REQUESTto the backend. The params contain no auto-pay info — the backend must independently check the policy's settings and decide whether to auto-reimburse.Dead Code Analysis
At
IOU/index.ts:10404, theisAutoReimbursablevariable incanIOUBePaidis alwaysfalsedue to contradictory logic between the ternary andcanBeAutoReimbursed(). This is used on line 10425 (!isAutoReimbursable) to determine whether to show the Pay button — since it's alwaysfalse, the Pay button always shows.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR for the frontend fix (dead code incanIOUBePaid), or@MelvinBot <your feedback>to refine this analysis. Note that the core issue (auto-pay not triggering) requires a backend investigation of theApproveMoneyRequesthandler.melvin-bot commentedon Feb 19, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (
External)[-]Workflows - Report is not auto-paid despite enabled feature[/-][+][$250] Workflows - Report is not auto-paid despite enabled feature[/+]melvin-bot commentedon Feb 19, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022024587396009911903
btkcodedev commentedon Feb 19, 2026
BE issue
mallenexpensify commentedon Feb 19, 2026
Thanks @btkcodedev , removed
Help Wantedsince it's backend28 remaining items
joekaufmanexpensify commentedon Mar 16, 2026
Still held
cristipaval commentedon Mar 17, 2026
Asked for a retest here
m-natarajan commentedon Mar 17, 2026
Reproduce, Chrome, Xiaomi Redmi Note 10 / Android 12, v9.3.39-0
Screenrecorder-2026-03-17-16-21-20-951.mp4
Screen.Recording.2026-03-17.at.15.44.10.mp4
s77rt commentedon Mar 19, 2026
I don't think this is a bug. The policy needs to have.valid payments accounts to trigger the auto-reimbursements.
s77rt commentedon Mar 19, 2026
How did even get to enable
Auto-pay approved reports? It should be locked if no account is setcristipaval commentedon Mar 19, 2026
@m-natarajan could you please reply to the above question? 🙏
m-natarajan commentedon Mar 19, 2026
@s77rt
The user added the bank account as per this video. Are you asking about the submitter?
552371171-813a51b6-f285-4dc3-a999-3992d59983fe.mp4
s77rt commentedon Mar 21, 2026
@m-natarajan From the logs I see that both payer and submitter are using same bank account. You can't pay yourself when credit and debit bank accounts are the same. If you change the bank account of the submitter or just remove it, you will see that the payment will be initiated automatically.
Screen.Recording.2026-03-21.at.10.27.31.AM.mov
m-natarajan commentedon Mar 23, 2026
@s77rt Asked for a retest based on your comments
m-natarajan commentedon Mar 23, 2026
Works with new instructions, Win 11 / Chrome, v9.3.42-0
bandicam.2026-03-23.17-20-59-749.mp4
cristipaval commentedon Mar 24, 2026
Ok, so this could be closed now, correct @s77rt?
s77rt commentedon Mar 24, 2026
Yes let's close
cristipaval commentedon Mar 24, 2026
Thanks a lot for investigating it, @s77rt! 🙏