-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Due for payment 2025-05-30] [$250] Invoice - Pay button appears in invoice preview for sender after receiver pays as business #61315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Triggered auto assignment to @mallenexpensify ( |
@mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Job added to Upwork: https://www.upwork.com/jobs/~021919538908936604963 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
Seems like it could be worked on by a contributor. |
ProposalPlease re-state the problem that we are trying to solve in this issue.After paying invoice as business, What is the root cause of that problem?If the invoice receiver has type From userA's side, App/src/libs/ReportPreviewActionUtils.ts Lines 129 to 134 in 0601503
What changes do you think we should make in order to solve the problem?We should pass a new param App/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx Line 458 in 0601503
Then here we should return
App/src/libs/ReportPreviewActionUtils.ts Lines 129 to 134 in 0601503
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?Update What alternative solutions did you explore? (Optional)We can get the
App/src/libs/ReportPreviewActionUtils.ts Lines 129 to 134 in 0601503
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. |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem? When paying as business, the invoice receiver (User B) should see pay buttons for all invoices where they're an admin of the receiver policy. The invoice sender (User A) should never see pay buttons for invoices they've sent. App/src/libs/ReportPreviewActionUtils.ts has a function
The issue is that when we pass a policy to this function, the function doesn't check whether it's the invoice receiver's policy. The MoneyRequestReportPreviewContent component has access to the receiver policy but it's not properly using it. What changes do you think we should make in order to solve the problem?
return getReportPreviewAction(violations, iouReport, invoiceReceiverPolicy ?? policy, transactions, reportNameValuePairs);
// For business receivers, we need to check if the current user is the admin of the receiver policy
// If policy parameter is the invoiceReceiverPolicy (passed from MoneyRequestReportPreviewContent),
// then we check if the current user is an admin of that policy
return policy?.role === CONST.POLICY.ROLE.ADMIN; These changes ensure that:
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional) const invoiceReceiverPolicy = getPolicy(parentReport?.invoiceReceiver?.policyID);
return invoiceReceiverPolicy?.role === CONST.POLICY.ROLE.ADMIN; However, this would introduce an additional dependency and potentially duplicate policy fetching logic. The cleaner approach is to ensure the correct policy is passed from the component that already has access to both policies. |
@nkdengineer 's proposal looks good to me . 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @Julesssss, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
I agree with nkdengineer's solution which solves the root cause 👍 |
📣 @nkdengineer 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.50-0 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 2025-05-30. 🎊 For reference, here are some details about the assignees on this issue:
|
@fedirjh @mallenexpensify @fedirjh 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] |
Uh oh!
There was an error while loading. Please reload this page.
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: 9.1.39-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/6032955
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Money Requests
Action Performed:
Precondition:
Expected Result:
After paying invoice as business,
Actual Result:
After paying invoice as business,
Workaround:
Unknown
Platforms:
Screenshots/Videos
1.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mallenexpensifyThe text was updated successfully, but these errors were encountered: