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
[Exploratory] Expense-With instant submission, expense is not auto submitted. #101020
Version Number: V9.4.77-0 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://test-management.browserstack.com/projects/2219752/folder/53775228/test-cases/113924940 Email or phone of affected tester (no customers):Applausetester+aha@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Redmi note 10s android 13 App Component: Money Requests
Action Performed:
Launch app using Expensifail account
Create a workspace
Open workspace chat
Create a empty report
Go to workspace settings- workflows - submission change as instant
Go to workspace chat
Tap plus icon and create a manual expense
Expected Result:
With instant submission, expense must be auto submitted.
Actual Result:
With instant submission, expense is not auto submitted.
Instant submit is only applied when the App builds a brand-new expense report. Step 4 of the repro ("Create an empty report") makes that never happen.
Creating an empty report in the workspace chat points the chat at it: src/libs/actions/Report/index.ts:4702 writes iouReportID: reportID onto the parent workspace chat.
That branch is the only path to getExpenseReportStateAndStatus, the one function that turns instant submit into stateNum/statusNum = SUBMITTED. The existing report's stateNum/statusNum are never recomputed, so it stays OPEN (0/0) — an unsubmitted expense.
What changes do you think we should make in order to solve the problem?
In getMoneyRequestInformation, in the branch that reuses an existing expense report (MoneyRequestBuilder.ts:1452 onwards), also recompute state when the reused report is still open. Call getExpenseReportStateAndStatus(policy, isASAPSubmitBetaEnabled) and apply the result to the reused report whenever isOpenExpenseReport(iouReport) is true, in the same place the totals are already being mutated. That keeps the "add to an existing open report" flow but makes instant submit behave the way the setting promises: adding an expense submits the report.
This needs matching backend behaviour — RequestMoney must also submit the report it appends to, not only ones it creates. That part is outside this repo, so an internal engineer should confirm/handle it.
Add a regression test: there is currently no test that exercises instant submit through requestMoney/getMoneyRequestInformation.
What alternative solutions did you explore? (Optional)
Alternatives considered and ruled out
Make shouldCreateNewMoneyRequestReport return true when instant submit is on. This forces a fresh submitted report every time, which would break the deliberate "create an empty report, then add expenses to it" flow that the user explicitly started. Rejected.
autoReporting and autoReportingFrequency diverging.isInstantSubmitEnabled needs bothautoReporting === true and autoReportingFrequency === 'instant', but setWorkspaceAutoReportingFrequency only writes the frequency. A policy can therefore display "Instantly" while instant submit evaluates false. This is a real second bug worth its own issue, but it does not explain this repro: the user reached the frequency page through the Workflows accordion, which is gated on autoReporting being true.
The asapSubmit beta.ReportUtils.ts:7436 short-circuits every new expense report to OPEN when that beta is on, producing the same symptom with no empty report involved. Worth confirming the reporter's beta state, but the empty-report path reproduces deterministically without it.
Verification note. The code chain above was read and confirmed directly. A browser reproduction was attempted but the test session died before any step ran, so this analysis rests on code evidence, not a live repro.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/101020) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
@linhvovan29546 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
This is a BE issue, not FE. When an expense is added to a report that's still OPEN (e.g. a pre-created empty report) on a workspace with instant submit enabled, the FE correctly shows Waiting for your expenses to automatically submit shortly, this is the designed next-step message for policy.harvesting.enabled reports, telling the user the backend's harvest job will pick it up and submit it shortly, with a manual Submit button as a fallback.
The actual bug: that automatic submit never happens. The harvest job should submit this report the same way it does for a freshly-created report with instant submit on, but it doesn't follow through here.
Can an internal engineer look into why the harvest/auto-submit job isn't picking up this report?
Activity
applause-bot commentedon Sep 12, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/4ab317e2c583116c4976a1180a1242d8c880879066767dc2ce9c6a6a440a2753
MelvinBot commentedon Sep 24, 2026
Proposal
What is the root cause of that problem?
Instant submit is only applied when the App builds a brand-new expense report. Step 4 of the repro ("Create an empty report") makes that never happen.
Creating an empty report in the workspace chat points the chat at it:
src/libs/actions/Report/index.ts:4702writesiouReportID: reportIDonto the parent workspace chat.When the manual expense is then created,
src/libs/actions/IOU/MoneyRequestBuilder.ts:1409resolves that pointer and reuses the empty report.shouldCreateNewMoneyRequestReportreturnsfalsefor it, so the!iouReport || shouldCreateNewMoneyRequestReportbranch atMoneyRequestBuilder.ts:1433is skipped.That branch is the only path to
getExpenseReportStateAndStatus, the one function that turns instant submit intostateNum/statusNum = SUBMITTED. The existing report'sstateNum/statusNumare never recomputed, so it staysOPEN(0/0) — an unsubmitted expense.What changes do you think we should make in order to solve the problem?
In
getMoneyRequestInformation, in the branch that reuses an existing expense report (MoneyRequestBuilder.ts:1452onwards), also recompute state when the reused report is still open. CallgetExpenseReportStateAndStatus(policy, isASAPSubmitBetaEnabled)and apply the result to the reused report wheneverisOpenExpenseReport(iouReport)is true, in the same place the totals are already being mutated. That keeps the "add to an existing open report" flow but makes instant submit behave the way the setting promises: adding an expense submits the report.This needs matching backend behaviour —
RequestMoneymust also submit the report it appends to, not only ones it creates. That part is outside this repo, so an internal engineer should confirm/handle it.Add a regression test: there is currently no test that exercises instant submit through
requestMoney/getMoneyRequestInformation.What alternative solutions did you explore? (Optional)
Alternatives considered and ruled out
Make
shouldCreateNewMoneyRequestReportreturntruewhen instant submit is on. This forces a fresh submitted report every time, which would break the deliberate "create an empty report, then add expenses to it" flow that the user explicitly started. Rejected.autoReportingandautoReportingFrequencydiverging.isInstantSubmitEnabledneeds bothautoReporting === trueandautoReportingFrequency === 'instant', butsetWorkspaceAutoReportingFrequencyonly writes the frequency. A policy can therefore display "Instantly" while instant submit evaluatesfalse. This is a real second bug worth its own issue, but it does not explain this repro: the user reached the frequency page through the Workflows accordion, which is gated onautoReportingbeing true.The
asapSubmitbeta.ReportUtils.ts:7436short-circuits every new expense report toOPENwhen that beta is on, producing the same symptom with no empty report involved. Worth confirming the reporter's beta state, but the empty-report path reproduces deterministically without it.Widening since 9.4.81. Reuse the submitter's outstanding report when the chat has no iouReportID added a
getNewestOutstandingReportForUserfallback atMoneyRequestBuilder.ts:1412. That is not the cause here (the bug reproduces on 9.4.77-0), but it makes the same class of bypass fire in more situations.Verification note. The code chain above was read and confirmed directly. A browser reproduction was attempted but the test session died before any step ran, so this analysis rests on code evidence, not a live repro.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/101020)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run · no recording available
melvin-bot commentedon Sep 24, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @linhvovan29546 (
External)melvin-bot commentedon Sep 24, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
melvin-bot commentedon Sep 26, 2026
@linhvovan29546 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
6 remaining items
melvin-bot commentedon Oct 3, 2026
@linhvovan29546 Whoops! This issue is 2 days overdue. Let's get this updated quick!
linhvovan29546 commentedon Oct 5, 2026
This is a
BEissue, notFE. When an expense is added to a report that's still OPEN (e.g. a pre-created empty report) on a workspace with instant submit enabled, theFEcorrectly showsWaiting for your expenses to automatically submit shortly, this is the designed next-step message forpolicy.harvesting.enabledreports, telling the user the backend's harvest job will pick it up and submit it shortly, with a manual Submit button as a fallback.The actual bug: that automatic submit never happens. The harvest job should submit this report the same way it does for a freshly-created report with instant submit on, but it doesn't follow through here.
Can an internal engineer look into why the harvest/auto-submit job isn't picking up this report?
🎀 👀 🎀 C+ reviewed
melvin-bot commentedon Oct 5, 2026
Triggered auto assignment to @justinpersaud, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
justinpersaud commentedon Oct 7, 2026
I have a backend PR up to fix this. Will test it out tomorrow.
justinpersaud commentedon Oct 8, 2026
Backend fix is in review. I'll update here once it has been merged for a re-test.
justinpersaud commentedon Oct 9, 2026
Should be fixed in the backend. Can we get a retest @jponikarchuk ?
melvin-bot commentedon Oct 10, 2026
@justinpersaud @linhvovan29546 this issue is now 4 weeks old, please consider:
Thanks!
justinpersaud commentedon Oct 13, 2026
This should be resolved