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
[$250] Expense - Next steps are not visible when the approver opens the report for the first time #75474
Version Number: v9.2.60-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: Exp Email or phone of affected tester (no customers):biruknew45+ggsnkj@gmail.com Issue reported by: Applause Internal Team Device used: Web, mweb App Component: Money Requests
Action Performed:
Precondition -
Admin creates a workspace and adds a member.
Admin sets that member as the default approver.
As an admin, create an expense in the workspace chat
As an admin, click on the submit button, but do not open the report
As a member(approver), go to the workspace chat of the admin and open the report
Expected Result:
When the admin submits the report, the status updates from Draft to Outstanding. Approver views report as Outstanding in their account without having to click into the report.
Actual Result:
When the approver views the report, it shows as Draft until they click into the report, then it updates to Outstanding, showing the next steps (approval).
changed the title [-]Expense - Next steps are not visible when the approver opens the report for the first time[/-][+][$250] Expense - Next steps are not visible when the approver opens the report for the first time[/+]on Nov 26, 2025
Please re-state the problem that we are trying to solve in this issue.
Problem: When an approver opens a report immediately after an expense is submitted (before the next step data is available), the Next Steps section does not appear, which prevents the approver from seeing what action they need to take.
What is the root cause of that problem?
When openReport is called at src/libs/actions/Report.ts:980-991, it attempts to access the next step message data stored under the key reportNextStep_{reportID} in Onyx. However, when a new expense is submitted and an approver opens the report immediately, this data object does not exist yet because when openReport is called immediately after a report is submitted, it receives the response from the backend first, but the response does not include reportNextStep_{reportID}, so Onyx data cannot be updated with that information.
Additionally, when report states are updated through Pusher events (such as when an approver approves an expense), the backend does not always include reportNextStep_{reportId} in the Pusher payload. The client receives the report actions via Pusher but does not recalculate the next step message, leaving the reportNextStep_{reportID} object missing in Onyx.
As a result, the approver must reopen the report after the data has been populated (either through a subsequent openReport API call or a Pusher update that includes the next step data) before the Next Steps section becomes visible.
What changes do you think we should make in order to solve the problem?
This solution follows the same approach I outlined in this comment.
Create a new functionupdateNextStepFromPusherEvents in NextStepUtils.ts to handle next step message creation when report actions are received via Pusher:
Filter Pusher updates to find REPORT_ACTIONS updates that contain SUBMITTED, APPROVED, or UNAPPROVED action types
Check if Pusher events already contain reportNextStep_{reportId} updates - if they do, skip client-side recalculation and rely on the server-provided values
If reportNextStep_{reportId} is not present, extract the report ID from the REPORT_ACTIONS update
Get the report and policy data from Onyx
Use the report's statusNum (which is updated in the same Pusher batch) to determine the predicted next status
Build the new next step message using the existing buildOptimisticNextStep() function
Update Onyx with the recalculated next step message by merging it into the report object
Integrate the new function into the existing Pusher event handler in User.ts:
Import updateNextStepFromPusherEvents from NextStepUtils
Call updateNextStepFromPusherEvents() after Onyx.update() completes in the ONYX_API_UPDATE event handler
This ensures the next step message is created whenever relevant actions are received via Pusher, making it available when openReport is called
This solution ensures that the reportNextStep_{reportID} object exists when openReport is called, regardless of whether the data came from the server or was calculated client-side. The implementation prioritizes server-provided next step message data: if Pusher events contain reportNextStep_{reportId} updates, we use those values directly. Only when the server doesn't provide next step message data do we perform client-side recalculation based on the report's current status.
What alternative solutions did you explore? (Optional)
Server-side solution: The server could always include reportNextStep_{reportId} in Pusher payloads or openReport response. This would be ideal but requires backend changes.
Hey team! I am heading OoO until Dec. 17. If you need anything from a BZ perspective, please reach out in Slack, otherwise I will get it sorted as soon as I am back! Thanks!
I re-tested the flow. Now It appears that the approver sees the report as Outstanding without needing to click into the report.
In the first video (without my change applied), between 00:41 – 00:54, the approver’s view state (on the right) looks correct. However, after the approver completes the approval at 01:15, the owner’s view does not update accordingly.
before-change.mp4
With my change applied, after the approver approves the report, the owner’s view updates correctly and reflects the Approved status. See 00:59 in the second video.
Activity
melvin-bot commentedon Nov 18, 2025
Triggered auto assignment to @CortneyOfstad (
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.CortneyOfstad commentedon Nov 26, 2025
Able to recreate!
[-]Expense - Next steps are not visible when the approver opens the report for the first time[/-][+][$250] Expense - Next steps are not visible when the approver opens the report for the first time[/+]melvin-bot commentedon Nov 26, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021993733805230841191
melvin-bot commentedon Nov 26, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 (
External)fahimj commentedon Nov 28, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Problem: When an approver opens a report immediately after an expense is submitted (before the next step data is available), the Next Steps section does not appear, which prevents the approver from seeing what action they need to take.
What is the root cause of that problem?
When
openReportis called atsrc/libs/actions/Report.ts:980-991, it attempts to access the next step message data stored under the keyreportNextStep_{reportID}in Onyx. However, when a new expense is submitted and an approver opens the report immediately, this data object does not exist yet because whenopenReportis called immediately after a report is submitted, it receives the response from the backend first, but the response does not includereportNextStep_{reportID}, so Onyx data cannot be updated with that information.Additionally, when report states are updated through Pusher events (such as when an approver approves an expense), the backend does not always include
reportNextStep_{reportId}in the Pusher payload. The client receives the report actions via Pusher but does not recalculate the next step message, leaving thereportNextStep_{reportID}object missing in Onyx.As a result, the approver must reopen the report after the data has been populated (either through a subsequent
openReportAPI call or a Pusher update that includes the next step data) before the Next Steps section becomes visible.What changes do you think we should make in order to solve the problem?
This solution follows the same approach I outlined in this comment.
Create a new function
updateNextStepFromPusherEventsinNextStepUtils.tsto handle next step message creation when report actions are received via Pusher:reportNextStep_{reportId}updates - if they do, skip client-side recalculation and rely on the server-provided valuesreportNextStep_{reportId}is not present, extract the report ID from the REPORT_ACTIONS updatestatusNum(which is updated in the same Pusher batch) to determine the predicted next statusbuildOptimisticNextStep()functionIntegrate the new function into the existing Pusher event handler in
User.ts:updateNextStepFromPusherEventsfromNextStepUtilsupdateNextStepFromPusherEvents()afterOnyx.update()completes in theONYX_API_UPDATEevent handleropenReportis calledThis solution ensures that the
reportNextStep_{reportID}object exists whenopenReportis called, regardless of whether the data came from the server or was calculated client-side. The implementation prioritizes server-provided next step message data: if Pusher events containreportNextStep_{reportId}updates, we use those values directly. Only when the server doesn't provide next step message data do we perform client-side recalculation based on the report's current status.What alternative solutions did you explore? (Optional)
Server-side solution: The server could always include
reportNextStep_{reportId}in Pusher payloads oropenReportresponse. This would be ideal but requires backend changes.14 remaining items
parasharrajat commentedon Dec 10, 2025
Wrong issue probably @yuwenmemon this was created 21 days back
parasharrajat commentedon Dec 10, 2025
Here they are saying that this issue is present on prod too and they faced this again on my PR. Reason that my PR don't solve this issue.
melvin-bot commentedon Dec 10, 2025
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
CortneyOfstad commentedon Dec 11, 2025
Hey team! I am heading OoO until Dec. 17. If you need anything from a BZ perspective, please reach out in Slack, otherwise I will get it sorted as soon as I am back! Thanks!
fahimj commentedon Dec 11, 2025
I re-tested the flow. Now It appears that the approver sees the report as Outstanding without needing to click into the report.
In the first video (without my change applied), between 00:41 – 00:54, the approver’s view state (on the right) looks correct. However, after the approver completes the approval at 01:15, the owner’s view does not update accordingly.
before-change.mp4
With my change applied, after the approver approves the report, the owner’s view updates correctly and reflects the Approved status. See 00:59 in the second video.
after-fix.mp4
melvin-bot commentedon Dec 16, 2025
@hungvu193 Huh... This is 4 days overdue. Who can take care of this?
hungvu193 commentedon Dec 16, 2025
Will retest today
hungvu193 commentedon Dec 16, 2025
Oh I couldn't reproduce this issue on latest main, @fahimj are you still able to reproduce it?
fahimj commentedon Dec 16, 2025
I couldn't reproduce it using main, as in the first video in my previous comment
melvin-bot commentedon Dec 16, 2025
@CortneyOfstad @hungvu193 this issue is now 4 weeks old, please consider:
Thanks!
yuwenmemon commentedon Dec 16, 2025
Looks like it's been fixed then. Closing!