[$250] Report - Submit button is not displayed in second report to Approver
If you havenβt already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: v9.2.79-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://github.com/Expensify/App/pull/76510 Email or phone of affected tester (no customers): ndk.2303+153gmail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11 Home/Chrome App Component: Money Requests
Action Performed:
Preconditions:
- Owner create a workspace and invite account A and B as members. Set account A as non-admin Approver. Account B is still member
- Member create 2 reports with 1-2 expenses in each report
- Open https://staging.new.expensify.com/
- As approver, navigate to member's workspace chat
- Scroll to second report
- Open second report
- Click on 'More'
Expected Result:
Approver is able to see the submit button in submitter expense report
Actual Result:
'View' is shown at second report preview. 'Submit' button disappears in More menu in report
Workaround:
Unknown
Platforms:
- [x] Android: App
- [ ] Android: mWeb Chrome
- [x] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [ ] MacOS: Chrome / Safari
Screenshots/Videos
https://github.com/user-attachments/assets/36c6706d-c4d4-40de-b7cd-45e83a865ad1
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022001503863559841221
- Upwork Job ID: 2001503863559841221
- Last Price Increase: 2025-12-25
Issue Owner
Current Issue Owner: @jayeshmangwani
Triggered auto assignment to @strepanier03 (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.
Proposal
Please re-state the problem that we are trying to solve in this issue.
'View' is shown at second report preview. 'Submit' button disappears in More menu in report
What is the root cause of that problem?
When the report isn't submitted, the mangerID isn't the approver, then the check failed here
https://github.com/Expensify/App/blob/fcdbbc3d3dc33302d348a081e16ace1d127b05bf/src/libs/ReportSecondaryActionUtils.ts#L186-L189
What changes do you think we should make in order to solve the problem?
We should check if the report is a the manager or not by comparing getSubmitToAccountID(policy, report) with the currentUserAccountID. We should fix the same for report preview action.
const isManager = getSubmitToAccountID(policy, report) === currentUserAccountID || report.managerID === currentUserAccountID;
https://github.com/Expensify/App/blob/fcdbbc3d3dc33302d348a081e16ace1d127b05bf/src/libs/ReportSecondaryActionUtils.ts#L186-L189
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.
Job added to Upwork: https://www.upwork.com/jobs/~022001503863559841221
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (External)
Okay, reproducible on a Pixel 9 in Android: App. Sending on.
Proposal
The Submit button is not displayed in the second report because the conditional rendering logic does not correctly account for the approver role when the active report context changes.
Plan
Identify where the Submit button visibility is determined (e.g. ReportFooter / ReportActionsView)
Ensure the permission check explicitly allows approvers to submit reports in OPEN status
Verify the correct reportID and role data are read from Onyx for the second report to avoid stale state
Update the condition so the button is hidden only when submission is not permitted by role or report status
Testing
Web, iOS, Android
Confirm Submit button appears for approver on the second report
Verify successful submission and no regressions in existing report flows
I will follow the Contributor Guidelines and keep the fix minimal and regression-safe.
π£ @masimkhan1121-beep! π£ Hey, it seems we donβt have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
@nkdengineer, I tried to repro this on the latest dev but couldnβt. Can you confirm if the issue is still reproducing for you?
@jayeshmangwani I can reproduce on the latest main. The approver should be a non-admin approver.
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@jayeshmangwani Whoops! This issue is 2 days overdue. Let's get this updated quick!
Iβm still not able to repro this. Iβll ask if anyone on C+ can reproduce it and take this on.
https://github.com/user-attachments/assets/fc22017a-ff69-47f6-9092-e16ab511b192
I am able to reproduce. Submit button is not displayed in non-admin approver
https://github.com/user-attachments/assets/74e926ce-1399-4cd1-9658-d28ce77b63cb
Here's config: (both are members, not admins)
Taking this over as C+ from https://expensify.slack.com/archives/C02NK2DQWUX/p1766985937549569
@situchan From your given image, I think [email protected] also needs to be an Auditor to properly reproduce this issue and see the member's expense chat, isn't it?
Updated: In the OP steps, non-admin Approver also means account A must be Auditor
@situchan From your given image, I think [email protected] also needs to be an Auditor to properly reproduce this issue and see the member's expense chat, isn't it?
It's stated in repro step:
Set account A as non-admin Approver
Proposal
Please re-state the problem that we are trying to solve in this issue.
For non admin approver: View button is displayed in Report preview instead of Submit button and Submit option isn't there when open the report and click on More button.
What is the root cause of that problem?
The root cause lies in canSubmit function in src/libs/ReportPreviewActionUtils.ts and isSubmitAction function in src/libs/ReportSecondaryActionUtils.ts.
canSubmit function is responsible to show the Submit button in Report preview in workspace chat.
isSubmitAction function is responsible to show the Submit option in the dropdown of More button when opening the report.
In both functions, we are dependent on the report.managerID to choose whether to show Submit or not BUT after creating the report, report.managerID is set to the first approver and it won't be updated immediately or reflect the true current approver.
So report.managerID can be staled and these two functions uses report.managerID which leads non approver wouldn't see the Submit in either of places.
Note: When we submit the expense (neither as admin nor as approver but as a member) and retract then after retracting, the submit button is displayed to non admin approver for that retracted report.
What changes do you think we should make in order to solve the problem?
We need to use getSubmitToAccountID function which dynamically calculate who should be the approver or to whom should show the Submit button.
In canSubmit function:
Remove this line (From canSubmit and isSubmitAction functions) as we will move this line to top.
const submitToAccountID = getSubmitToAccountID(policy, report);
And use getSubmitToAccountID function to comparison with currentUserAccountID
// Replace this
const isManager = report.managerID === currentUserAccountID;
// With this
const submitToAccountID = getSubmitToAccountID(policy, report);
const isManager = submitToAccountID === currentUserAccountID || report.managerID === currentUserAccountID;
In isSubmitAction function:
use getSubmitToAccountID function to comparison with getCurrentUserAccountID()
// Replace this
const isManager = report.managerID === getCurrentUserAccountID();
// With this
const submitToAccountID = getSubmitToAccountID(policy, report);
const isManager = submitToAccountID === getCurrentUserAccountID() || report.managerID === getCurrentUserAccountID();
With this way, we will also call getSubmitToAccountID only once in both functions as we removed this line:
const submitToAccountID = getSubmitToAccountID(policy, report);
Note: I've gone through the other proposals above and I found, the first proposal only fixes this issue in More dropdown not in Report preview and it calls getSubmitToAccountID twice in the same function.
With this approach, the issue will be fixed in both places.
What alternative solutions did you explore? (Optional)
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.
@strepanier03 , please reassign this issue to @situchan as C+
@jayeshmangwani Sheena might be OoO till 2nd Jan, We need to wait.
@strepanier03 @jayeshmangwani 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!
@situchan I think we can reassign the issue later, but feel free to move forward with the review part for now.
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@strepanier03 Can you please reassign this issue to @situchan as C+ based on the above discussion?
@nkdengineer's proposed first. They also mentioned the fix in report preview action.
π π π C+ reviewed
Triggered auto assignment to @flodnv, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@situchan Thanks for the review of proposals but don't you think @nkdengineer proposal was too brief and didn't provide the clear picture.
I proposed all the places where the bug happened and provided the more comprehensive proposal.
I think we should also ask @flodnv which proposal to go.
It was clear enough for me to validate and test. The proposal doesn't need to be as detailed as PR. @Uzaifm127 to be familiar with our process, please refer to docs or other external issues where contributor was assigned.
I understand your point. But the first proposal you selected was way more brief and it isn't about posting as detail as PR but a strong proposal should demonstrate the issue, root cause and solution clearly and it should be comprehensive to a certain point. A strong proposal shows the understanding of the issue of contributor.
it doesn't seems fair that a proposal with minimal effort got selected.
Let's see what @flodnv will say
Issue not reproducible during KI retests. (First week)
π£ @situchan π An offer has been automatically sent to your Upwork account for the Contributor role π Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review π§βπ» Keep in mind: Code of Conduct | Contributing π