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
[Due for payment 2026-04-14] [Due for payment 2026-04-14] Reports -"Submit" button instead of "Done" if expense is created offline while on "Expenses" #87037
Version Number: 9.3.52.0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#86460 Email or phone of affected tester (no customers):ibellicotest+2250@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Motorola MotoG60 / Android 12 (Hybrid app) App Component: Search
Action Performed:
Prerequisite: "Track and budget expenses" selected during onboarding.
Prerequisite 2: Account has at least one workspace.
Prerequisite 3: Approvals and payments disabled.
Open the Expensify app.
Navigate to "Reports" > "Expenses"
Turn off internet connection.
Create a manual expense and submit it to workspace.
Note that when expense preview appears on "Expenses", a "Submit" button is displayed instead of "Done"
Navigate to "Inbox"
Note that "Mark as done" is visible on chat preview.
Open workspace chat.
Note that "Mark as done" button is visible on expense preview.
Return to "Reports" > "Expenses"
Turn on internet connection.
Note that "Submit" button is still visible.
Navigate to "Inbox" and return.
Note that now, "Done" button appears.
Expected Result:
When an expense is created while on "Expenses" section while offline, action button on preview, should automatically display "Done", if workspace has approvals and payments disabled.
Actual Result:
"Submit" button is displayed on expense preview instead of "Done", if expense is created while offline on "Expenses" section on "Reports".
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Investigation Summary - Frontend bug. Causing PR: #86460 (Update CTA and workspace chat copy for track-intent users) by @MelvinBot - High confidence. Related Issues: #86223. Recommendation: REVERT. PR 86460 introduced a race condition where the Submit vs Mark as done button label decision depends on a policy loaded from Onyx. When an expense is created offline, the newly created iouReport may not yet have its policyID written into Onyx (or the policy entry itself may not be present), causing isSubmitAndClose(policy) to return false (since policy is undefined). This makes the button fall back to Submit instead of Done. Once connectivity is restored the Onyx store is updated and the correct policy data becomes available, explaining why the button fixes itself after navigating away and back. Labels: No label changes. DeployBlockerCash is correctly applied; this is a staging-only bug caused by an App PR. Evidence: (1) The melvin-bot explicitly linked this deploy blocker to PR 86460. (2) Bug reproduces only in staging, consistent with PR 86460 being in the staging deploy. (3) The repro requires offline expense creation + track-intent user + workspace with approvals disabled - exactly what PR 86460 targets. (4) Bug self-corrects after navigating away and back, consistent with Onyx loading policy data once network is restored. Verification: Key file src/components/ReportActionItem/MoneyRequestReportPreview/SubmitActionButton.tsx was modified by PR 86460. Button text logic: isTrackIntentUser AND isSubmitAndClose(policy) ? markAsDone : submit. policy is fetched via useOnyx on COLLECTION.POLICY keyed by iouReport.policyID. When offline with freshly created report, policyID may not be in Onyx yet so policy is undefined. isSubmitAndClose(undefined) returns false because undefined.approvalMode is not OPTIONAL. Root Cause: PR 86460 did not account for the offline scenario where policy is not yet loaded in Onyx during optimistic expense creation. Fix needs to handle the case where policy is temporarily unavailable and preserve the Mark as done label.
Please re-state the problem that we are trying to solve in this issue.
When a track-intent user creates an expense offline while on the "Expenses" tab in Reports, the action button shows "Submit" instead of "Done". It persists even after going back online until the user navigates away and back.
What is the root cause of that problem?
The mobile layout for individual transaction search items uses UserInfoAndActionButtonRow, which passes policyID={item.policyID} to ActionCell (UserInfoAndActionButtonRow.tsx:77).
The item here is a TransactionListItemType, which extends the Transaction type. The Transaction type does not have a policyID field — that field only exists on Report. When the search API returns data from the backend, it adds policyID to the flat transaction data for convenience, so item.policyID works. But when an expense is created offline, the optimistic search snapshot uses a regular Transaction object (spread at IOU/index.ts:12078-12084), which has no policyID.
As a result, ActionCell looks up useOnyx('policy_undefined'), gets undefined back, and isSubmitAndClose(actionCellPolicy) returns false — so the button falls back to "Submit" instead of "Done".
Notably, the large screen layout does NOT have this bug: TransactionItemRow correctly passes policyID={report?.policyID} (TransactionItemRow/index.tsx:442), which works because the report IS included in the optimistic snapshot and has a valid policyID.
The LHN and report preview also work correctly because they use different components (OptionRowLHN and SubmitActionButton) that resolve the policy through the report's policyID.
What changes do you think we should make in order to fix the problem?
In UserInfoAndActionButtonRow.tsx, change line 77 from:
This adds a fallback to the report's policyID (which is always available on the TransactionListItemType's report field, even for optimistic data), matching the approach already used by TransactionItemRow.
Supporting evidence
Key code paths:
ActionCell determines "Done" vs "Submit" at ActionCell/index.tsx:87: const shouldUseMarkAsDone = isTrackIntentUser && isSubmitAndClose(actionCellPolicy) && action === CONST.SEARCH.ACTION_TYPES.SUBMIT;
actionCellPolicy is loaded via useOnyx using the policyID prop at line 46
Optimistic snapshot data at IOU/index.ts:12064-12098 includes the policy and report objects, but the transaction is spread from a regular Transaction (no policyID)
TransactionListItem already computes a fallback policyID at line 79: const policyID = transactionItem.policyID || snapshotReport?.policyID || activePolicyID; — but this value is NOT passed to UserInfoAndActionButtonRow
Why it persists after going online (step 12): The search snapshot data isn't re-fetched on reconnect — it requires navigation away/back to trigger a fresh search API call which returns backend data with policyID on the transaction.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.52-9 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
changed the title [-]Reports -"Submit" button instead of "Done" if expense is created offline while on "Expenses"[/-][+][Due for payment 2026-04-14] Reports -"Submit" button instead of "Done" if expense is created offline while on "Expenses"[/+]on Apr 7, 2026
@Valforte The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
changed the title [-][Due for payment 2026-04-14] Reports -"Submit" button instead of "Done" if expense is created offline while on "Expenses"[/-][+][Due for payment 2026-04-14] [Due for payment 2026-04-14] Reports -"Submit" button instead of "Done" if expense is created offline while on "Expenses"[/+]on Apr 7, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.53-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@Valforte@mallenexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon Apr 2, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #86460
melvin-bot commentedon Apr 2, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 2, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
OSBotify commentedon Apr 2, 2026
Investigation Summary - Frontend bug. Causing PR: #86460 (Update CTA and workspace chat copy for track-intent users) by @MelvinBot - High confidence. Related Issues: #86223. Recommendation: REVERT. PR 86460 introduced a race condition where the Submit vs Mark as done button label decision depends on a policy loaded from Onyx. When an expense is created offline, the newly created iouReport may not yet have its policyID written into Onyx (or the policy entry itself may not be present), causing isSubmitAndClose(policy) to return false (since policy is undefined). This makes the button fall back to Submit instead of Done. Once connectivity is restored the Onyx store is updated and the correct policy data becomes available, explaining why the button fixes itself after navigating away and back. Labels: No label changes. DeployBlockerCash is correctly applied; this is a staging-only bug caused by an App PR. Evidence: (1) The melvin-bot explicitly linked this deploy blocker to PR 86460. (2) Bug reproduces only in staging, consistent with PR 86460 being in the staging deploy. (3) The repro requires offline expense creation + track-intent user + workspace with approvals disabled - exactly what PR 86460 targets. (4) Bug self-corrects after navigating away and back, consistent with Onyx loading policy data once network is restored. Verification: Key file src/components/ReportActionItem/MoneyRequestReportPreview/SubmitActionButton.tsx was modified by PR 86460. Button text logic: isTrackIntentUser AND isSubmitAndClose(policy) ? markAsDone : submit. policy is fetched via useOnyx on COLLECTION.POLICY keyed by iouReport.policyID. When offline with freshly created report, policyID may not be in Onyx yet so policy is undefined. isSubmitAndClose(undefined) returns false because undefined.approvalMode is not OPTIONAL. Root Cause: PR 86460 did not account for the offline scenario where policy is not yet loaded in Onyx during optimistic expense creation. Fix needs to handle the case where policy is temporarily unavailable and preserve the Mark as done label.
MelvinBot commentedon Apr 2, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a track-intent user creates an expense offline while on the "Expenses" tab in Reports, the action button shows "Submit" instead of "Done". It persists even after going back online until the user navigates away and back.
What is the root cause of that problem?
The mobile layout for individual transaction search items uses
UserInfoAndActionButtonRow, which passespolicyID={item.policyID}toActionCell(UserInfoAndActionButtonRow.tsx:77).The
itemhere is aTransactionListItemType, which extends theTransactiontype. TheTransactiontype does not have apolicyIDfield — that field only exists onReport. When the search API returns data from the backend, it addspolicyIDto the flat transaction data for convenience, soitem.policyIDworks. But when an expense is created offline, the optimistic search snapshot uses a regularTransactionobject (spread atIOU/index.ts:12078-12084), which has nopolicyID.As a result,
ActionCelllooks upuseOnyx('policy_undefined'), getsundefinedback, andisSubmitAndClose(actionCellPolicy)returnsfalse— so the button falls back to "Submit" instead of "Done".Notably, the large screen layout does NOT have this bug:
TransactionItemRowcorrectly passespolicyID={report?.policyID}(TransactionItemRow/index.tsx:442), which works because the report IS included in the optimistic snapshot and has a validpolicyID.The LHN and report preview also work correctly because they use different components (
OptionRowLHNandSubmitActionButton) that resolve the policy through the report'spolicyID.What changes do you think we should make in order to fix the problem?
In
UserInfoAndActionButtonRow.tsx, change line 77 from:to:
This adds a fallback to the report's
policyID(which is always available on theTransactionListItemType'sreportfield, even for optimistic data), matching the approach already used byTransactionItemRow.Supporting evidence
Key code paths:
ActionCelldetermines "Done" vs "Submit" atActionCell/index.tsx:87:const shouldUseMarkAsDone = isTrackIntentUser && isSubmitAndClose(actionCellPolicy) && action === CONST.SEARCH.ACTION_TYPES.SUBMIT;actionCellPolicyis loaded viauseOnyxusing thepolicyIDprop at line 46IOU/index.ts:12064-12098includes the policy and report objects, but the transaction is spread from a regularTransaction(nopolicyID)TransactionListItemalready computes a fallbackpolicyIDat line 79:const policyID = transactionItem.policyID || snapshotReport?.policyID || activePolicyID;— but this value is NOT passed toUserInfoAndActionButtonRowWhy it persists after going online (step 12): The search snapshot data isn't re-fetched on reconnect — it requires navigation away/back to trigger a fresh search API call which returns backend data with
policyIDon the transaction.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.jasperhuangg commentedon Apr 3, 2026
reverting #86460 in #87106, should fix this
m-natarajan commentedon Apr 3, 2026
Mark as done button not displayed, Galaxy A55/ Android 16, v9.3.52-3 PR: 87106 Ad-hoc
repro-.issue.87037.mp4
1 remaining item
melvin-bot commentedon Apr 7, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.52-9 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-04-14. 🎊
[-]Reports -"Submit" button instead of "Done" if expense is created offline while on "Expenses"[/-][+][Due for payment 2026-04-14] Reports -"Submit" button instead of "Done" if expense is created offline while on "Expenses"[/+]melvin-bot commentedon Apr 7, 2026
@Valforte The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
melvin-bot commentedon Apr 7, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)[-][Due for payment 2026-04-14] Reports -"Submit" button instead of "Done" if expense is created offline while on "Expenses"[/-][+][Due for payment 2026-04-14] [Due for payment 2026-04-14] Reports -"Submit" button instead of "Done" if expense is created offline while on "Expenses"[/+]melvin-bot commentedon Apr 7, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.53-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-04-14. 🎊
melvin-bot commentedon Apr 7, 2026
@Valforte @mallenexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]