Repository navigation
[Due for payment 2026-10-16] [$175] Reports- preview Disabled submit button not displayed to prevent self-approval wp #100709
Description
Activity
- addedDailyKSv2KSv2BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Sep 9, 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/382126e64fc48b24fc9274370557986caa27115a9184ed1d37d07244fd730702Proposal
What is the root cause of that problem?
The report preview never renders a Submit button in this state, so there is nothing to disable. The two Submit surfaces resolve their action differently:
- Report header —
ReportPrimaryActionUtils.ts:155blocks the SUBMIT action for prevented self-approval only when the current user is not the submitter (&& !isReportSubmitter). The submitter still gets SUBMIT, andSubmitPrimaryActionthen renders it disabled. - Report preview —
canSubmitinReportPreviewActionUtils.ts:76-78has the same check without the!isReportSubmitterqualifier, so it returnsfalsefor the submitter.getReportPreviewActiontherefore never returnsSUBMIT, andReportPreviewActionButtonfalls through tonulland renders only the View button.
This makes the gate added by #97946 (
SubmitActionButton.tsx:124-133,isDisabledat L195) unreachable for the prevent-self-approval branch — the component is never mounted. Its unit test mocksshouldBlockSubmitDueToPreventSelfApproval, so it passes while the real app skips the component, which is why this only surfaced in QA.Why the underlying "block submission" condition really is true here
shouldBlockSubmitDueToPreventSelfApproval(ReportUtils.ts:10102-10111) comparesgetNextApproverAccountID(report)againstreport.ownerAccountID. With a self-approval workspace,getApprovalChainpops the owner from the chain whenpreventSelfApprovalis set, leaving it empty, sogetNextApproverAccountIDfalls back togetSubmitToAccountID= the owner. Both gates agree the submission is blocked; they only disagree on whether to hide or disable the button.Verification note: I could not reproduce the blocked state at runtime — "Prevent self-approvals" is behind the Control-plan upgrade paywall on a test workspace, and the test account is on Collect. With the setting off I confirmed the control case: preview card and report header both show an enabled Submit. The root cause above rests on code evidence, not a live repro.
What changes do you think we should make in order to solve the problem?
Align
canSubmitwith the header'sisSubmitAction: inReportPreviewActionUtils.ts:76, add the!isSubmitterqualifier (the localisSubmitteris already computed at L57) so the early return only applies to non-submitters.The preview action then resolves to
SUBMITfor the submitter,SubmitActionButtonmounts, and theisDisabledgate from #97946 renders it disabled — matching the header and the documented expected result. No change toSubmitActionButtonis needed.Add a unit test for
canSubmit/getReportPreviewActioncoveringpreventSelfApproval+ submitter →SUBMIT(there is currently no test file forReportPreviewActionUtils), so the preview and header gates cannot drift apart again.What alternative solutions did you explore? (Optional)
Treat the preview's current hide-the-button behavior as intended and correct the QA/test plan instead. That still leaves the header showing a disabled Submit while the preview shows no Submit for the same report, so a product decision is needed either way. Hiding-vs-disabling parity should be settled before the fix lands.
Related issues
- [Due for payment 2026-09-16] [$250] Submit button remains enabled for violating reports and shows generic error when strict workflow rules are enforced #92367 — the parent issue fix: disable report preview Submit button when strict workflow rules block submission #97946 fixed; step 7 of that PR's test plan is the step this QA failure comes from.
Next Steps for Contributor+ team:
To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/100709)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
- Report header —
- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Sep 9, 2026 Triggered auto assignment to Contributor-plus team member for initial proposal review - @thelullabyy (
External)Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
@thelullabyy Huh... This is 4 days overdue. Who can take care of this?
@MelvinBot please draft a PR for me to test your suggestions
Reacted by melvin-bot🤖 Draft PR created: #101148
Please mark it as "Ready for review" when it's ready.
What changed: one line in
src/libs/ReportPreviewActionUtils.ts:76—canSubmitnow qualifies the prevent-self-approval early return with!isSubmitter, matchingisSubmitActionin the report header. The preview action resolves toSUBMITfor the submitter,SubmitActionButtonmounts, and theisDisabledgate from #97946 renders it disabled. No change toSubmitActionButtonwas needed.Regression tests: two cases added to
tests/actions/ReportPreviewActionUtilsTest.ts— submitter expectsSUBMIT, non-submitter expects notSUBMIT. I confirmed the first one fails onmainand passes with the fix, so it's a real guard rather than a passing no-op.Checks I ran locally
Check Result npm run lint-changed✅ pass npm run typecheck✅ pass npm run spell-changed✅ pass npm test—ReportPreviewActionUtilsTest,ReportPrimaryActionUtilsTest,MoneyRequestReportPreview,ReportPreviewActionButtonTest,SubmitActionButtonTest,useReportPreviewActionDecisionTest,ReportWorkflowTest✅ 260 passed Not applicable:
npm run prettier(no such script here — ESLint enforces formatting), the React Compiler check (no.tsxchanged), the Storybook smoke test (no component changed).One correction to my earlier proposal: I said there was no test file for
ReportPreviewActionUtils. There is —tests/actions/ReportPreviewActionUtilsTest.ts— so the new cases went there instead of into a new file.Two things to confirm before merging:
- I could not verify this in a browser. The automated web session for this run was stuck on a blank page and couldn't be driven, so the fix rests on unit-test and code evidence, not a live repro. Please confirm the disabled button visually when you test.
- The hide-vs-disable question is still open. This PR makes the preview match the header, which is what the issue's expected result describes. If the intended product behavior is actually to hide Submit in both places, the header needs the change instead and this PR should be rejected.
The PR is on an upstream branch since I can't push to your fork — #101148 has the commands to copy it over if you'd rather own it from there.
view run · no recording available
Reviewing...
12 remaining items
- addedReviewingHas a PR in reviewHas a PR in reviewWeeklyKSv2KSv2and removedDailyKSv2KSv2
on Sep 28, 2026 - changed the title
[-]Reports- preview Disabled submit button not displayed to prevent self-approval wp[/-][+][$175] Reports- preview Disabled submit button not displayed to prevent self-approval wp[/+]on Oct 7, 2026 Job added to Upwork: https://www.upwork.com/jobs/~022107897107203347496
Hi, I noticed the Upwork job was just posted, but this issue already has PR #101148 under review. Is this job still open to new contributors, or is it for the existing implementation?
📣 @haonnedu! 📣
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>Contributor details
Your Expensify account email: haonguyen.dev.work@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/haonn- addedDailyKSv2KSv2and removedReviewingHas a PR in reviewHas a PR in reviewWeeklyKSv2KSv2
on Oct 9, 2026 - changed the title
[-][$175] Reports- preview Disabled submit button not displayed to prevent self-approval wp[/-][+][Due for payment 2026-10-16] [$175] Reports- preview Disabled submit button not displayed to prevent self-approval wp[/+]on Oct 9, 2026 The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.6-6 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-10-16. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.4.74-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: #97946
Email or phone of affected tester (no customers): applausetester+dk45@applause.expensifail.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:
Expected Result:
verify the preview Submit button is disabled
Actual Result:
The disabled submit button is not displayed in preview report
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug7254708_1788923759675.bandicam_2026-09-09_10-12-24-533.mp4
View all open jobs on GitHub
Issue Owner
Current Issue Owner: @thelullabyyUpwork Automation - Do Not Edit