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 for payment 2025-12-19] [$250] Next steps- Next steps message remain unchanged until refresh #70926
Version Number: v9.2.16-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Exploratory Email or phone of affected tester (no customers):testpayment935@gmail.com Issue reported by: Applause Internal Team Device used: Web, mWeb App Component: Chat Report View
Please re-state the problem that we are trying to solve in this issue.
When a user removes an IOU from an expense report, the next step message does not automatically update to reflect the new state of the report. Specifically:
Expected Behavior: After removing an IOU from a report, the next step message should change from "Waiting for you to submit expense(s)" to "Waiting for you to add expense(s)"
Actual Behavior: The next step message remains unchanged, still showing "Waiting for you to submit expense(s)" until the user refreshes the page or navigates away and back
What is the root cause of that problem?
The root cause lies in the changeTransactionsReport function in src/libs/actions/Transaction.ts. When transactions are moved between reports (including when removing an IOU from a report), the function only updates the next step message for the destination report, not for the source report that had transactions removed from it.
The function calculates updated totals for all affected reports but only updates the next step message for the destination report (line 1170 in the original code)
When an IOU is removed from a report, the source report's next step message is not recalculated, even though its total has changed
This creates a state where the report's total reflects the removal of expenses, but the next step message still indicates the old state
The issue is that reportID here refers to the destination report (where transactions are moved TO), not the source report (where transactions are removed FROM).
What changes do you think we should make in order to solve the problem?
The fix involves modifying the changeTransactionsReport function to update the next step message for all reports that have their totals changed, not just the destination report.
Collect all report IDs that have updated totals from the updatedReportTotals object
Calculate and update the next step message for each affected report using its updated totals
Updated Implementation:
// 9. Update next step for all affected reportsconstallAffectedReportIDs=newSet([...Object.keys(updatedReportTotals),reportID]);allAffectedReportIDs.forEach((affectedReportID)=>{constaffectedReport=allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${affectedReportID}`];if(!affectedReport){return;}constupdatedReport={
...affectedReport,total: updatedReportTotals[affectedReportID]??affectedReport.total,reportID: affectedReport.reportID??affectedReportID,};consthasViolations=hasViolationsReportUtils(updatedReport.reportID,allTransactionViolation);constoptimisticNextStep=buildNextStepNew(updatedReport,policy,accountID,email,hasViolations,isASAPSubmitBetaEnabled,updatedReport.statusNum??CONST.REPORT.STATUS_NUM.OPEN,shouldFixViolations,);optimisticData.push({onyxMethod: Onyx.METHOD.MERGE,key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${affectedReportID}`,value: optimisticNextStep,});// Only add failure data for the main report to avoid conflictsif(affectedReportID===reportID){failureData.push({onyxMethod: Onyx.METHOD.MERGE,key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${reportID}`,value: reportNextStep,});}});
Screen.Recording.2025-09-20.at.8.02.39.PM.mov
We can make certain optimisations in the code while working on the final implementation.
Now when an IOU is removed from a report, both the source report (where the IOU was removed) and the destination report (unreported) get their next step messages updated
Each report's next step is calculated using its updated totals, ensuring the message accurately reflects whether the report has expenses or not
The optimistic updates ensure the UI reflects the correct state immediately, without requiring a page refresh
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
describe('changeTransactionsReport - Next Step Updates',()=>{it('should update next step message when removing last expense from report',()=>{// Test implementation});it('should maintain submit message when removing expense from multi-expense report',()=>{// Test implementation});it('should update next steps for both source and destination reports',()=>{// Test implementation});});
What changes do you think we should make in order to solve the problem?
Because we will not have the most accurate data for the old report, so I think the best way here will be to handle it in the Back End
That means after calling the api ChangeTransactionsReport, we will create another params called oldReportIDList and it will include all the oldReportIDhere and the Back End will return the onyx key reportNextStep of those reports
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Next steps- Next steps message remain unchanged until refresh[/-][+][$250] Next steps- Next steps message remain unchanged until refresh[/+]on Sep 22, 2025
changed the title [-][$250] Next steps- Next steps message remain unchanged until refresh[/-][+][$125] Next steps- Next steps message remain unchanged until refresh[/+]on Sep 22, 2025
I see you became eligible for NewDot payments on 2025-09-20 and we hired you here 2025-10-01, so confirmed we are good to pay you via NewDot for this one 👍
Activity
melvin-bot commentedon Sep 20, 2025
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.ShridharGoel commentedon Sep 20, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user removes an IOU from an expense report, the next step message does not automatically update to reflect the new state of the report. Specifically:
What is the root cause of that problem?
The root cause lies in the
changeTransactionsReportfunction insrc/libs/actions/Transaction.ts. When transactions are moved between reports (including when removing an IOU from a report), the function only updates the next step message for the destination report, not for the source report that had transactions removed from it.The function calculates updated totals for all affected reports but only updates the next step message for the destination report (line 1170 in the original code)
When an IOU is removed from a report, the source report's next step message is not recalculated, even though its total has changed
This creates a state where the report's total reflects the removal of expenses, but the next step message still indicates the old state
App/src/libs/actions/Transaction.ts
Lines 1155 to 1177 in d41575d
The issue is that
reportIDhere refers to the destination report (where transactions are moved TO), not the source report (where transactions are removed FROM).What changes do you think we should make in order to solve the problem?
The fix involves modifying the
changeTransactionsReportfunction to update the next step message for all reports that have their totals changed, not just the destination report.updatedReportTotalsobjectUpdated Implementation:
Screen.Recording.2025-09-20.at.8.02.39.PM.mov
We can make certain optimisations in the code while working on the final implementation.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
daledah commentedon Sep 20, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The next step message remain unchanged saying "waiting for you to submit expenses" until refresh or navigating back again.
What is the root cause of that problem?
We are just handling the next step for the report that the transaction will be moved to here.
App/src/libs/actions/Transaction.ts
Lines 1156 to 1177 in d41575d
What changes do you think we should make in order to solve the problem?
Because we will not have the most accurate data for the old report, so I think the best way here will be to handle it in the Back End
That means after calling the api
ChangeTransactionsReport, we will create another params calledoldReportIDListand it will include all theoldReportIDhere and the Back End will return the onyx keyreportNextStepof those reportsApp/src/libs/actions/Transaction.ts
Lines 1179 to 1183 in d41575d
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
joekaufmanexpensify commentedon Sep 22, 2025
This is a minor issue, but would be good to address 👍
[-]Next steps- Next steps message remain unchanged until refresh[/-][+][$250] Next steps- Next steps message remain unchanged until refresh[/+]melvin-bot commentedon Sep 22, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021970154128291812017
melvin-bot commentedon Sep 22, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (
External)[-][$250] Next steps- Next steps message remain unchanged until refresh[/-][+][$125] Next steps- Next steps message remain unchanged until refresh[/+]melvin-bot commentedon Sep 22, 2025
59 remaining items
ShridharGoel commentedon Dec 19, 2025
@joekaufmanexpensify This is due for payment, thanks
joekaufmanexpensify commentedon Dec 19, 2025
Checked out the DB above and it looks like it was not caused by this issue's PR so no regression penalty here.
joekaufmanexpensify commentedon Dec 19, 2025
OG Upwork job closed before @ShridharGoel accepted the offer, so I opened a new job and sent a new offer. Please accept @ShridharGoel
joekaufmanexpensify commentedon Dec 19, 2025
Payment Summary
ShridharGoel commentedon Dec 19, 2025
@joekaufmanexpensify My payment is also via NewDot
joekaufmanexpensify commentedon Dec 19, 2025
I see you became eligible for NewDot payments on 2025-09-20 and we hired you here 2025-10-01, so confirmed we are good to pay you via NewDot for this one 👍
joekaufmanexpensify commentedon Dec 19, 2025
Upwork job closed
joekaufmanexpensify commentedon Dec 19, 2025
@ShridharGoel @parasharrajat please request payment at your earliest convenience. Closing as this is otherwise all set 👍
JmillsExpensify commentedon Dec 23, 2025
$250 approved for @ShridharGoel
parasharrajat commentedon Mar 19, 2026
Payment requested as per #70926 (comment)
twisterdotcom commentedon Mar 23, 2026
Confirming Payment Summary. @parasharrajat paid via New Expensify