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 - Submit expense option is not disabled for users who are invited to expense report #46340
Version Number: 9.0.13-3 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail:https://expensify.testrail.io/index.php?/tests/view/4771930 Issue reported by: Applause - Internal Team
Action Performed:
Go to staging.new.expensify.com
[User A] Submit two expenses to User B
[User A] Click on the expense preview in the main chat to go to expense report
[User A] Send a user mention containing User C
[User A] Click Invite from the whisper message
[User A] Send a message in the transaction thread
[User C] Open the invited expense report
[User C] Click + > Submit expense > Manual
[User C] Enter amount > Next
Expected Result:
Submit expense option should be disabled for the users who are invited to the expense rep
Actual Result:
Submit expense option is not disabled for the users who are invited to the expense report
Invited user can go through the flow but blocked at the confirmation page
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
@OfstadC FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Edited by proposal-police: This proposal was edited at 2023-10-21T22:06:00Z.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Submit expense option is not disabled for the users who are invited to the expense report
Invited user can go through the flow but blocked at the confirmation page
What is the root cause of that problem?
For the iou report, the policy is the personal policy of the user so canAddOrDeleteTransactions always returns true without checking whether the user can access the parent report or not.
When we submit an expense, we get the participants from the chat report and in this case, the invited user can't access this report so participants is an empty object, and then the confirm button is disabled on the confirmation page
For the expense report, the invited user doesn't have the policy data of the expense report, and canAddTransactions also returns true in this case then the invited user can see the submit expense option in the expense report
if (isExpenseReport(moneyRequestReport) && currentUserAccountID !== moneyRequestReport?.managerID) {
return false;
}
or we can add a case in canAddOrDeleteTransactions for the expense report that will return false if the current user isn't the managerID (the submitter) of the expense report
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
Activity
melvin-bot commentedon Jul 27, 2024
Triggered auto assignment to @OfstadC (
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.lanitochka17 commentedon Jul 27, 2024
@OfstadC FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
lanitochka17 commentedon Jul 27, 2024
We think that this bug might be related to #wave-collect - Release 1
nkdengineer commentedon Jul 27, 2024
Edited by proposal-police: This proposal was edited at 2023-10-21T22:06:00Z.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Submit expense option is not disabled for the users who are invited to the expense report
Invited user can go through the flow but blocked at the confirmation page
What is the root cause of that problem?
For the iou report, the policy is the personal policy of the user so
canAddOrDeleteTransactionsalways returns true without checking whether the user can access the parent report or not.App/src/libs/ReportUtils.ts
Lines 1604 to 1608 in 5e65276
When we submit an expense, we get the
participantsfrom the chat report and in this case, the invited user can't access this report soparticipantsis an empty object, and then the confirm button is disabled on the confirmation pageApp/src/libs/actions/IOU.ts
Line 7315 in 5e65276
For the expense report, the invited user doesn't have the policy data of the expense report, and
canAddTransactionsalso returnstruein this case then the invited user can see the submit expense option in the expense reportApp/src/libs/ReportUtils.ts
Line 6123 in 87c116b
What changes do you think we should make in order to solve the problem?
We should check if the user can not access the parent report we will return
falseApp/src/libs/ReportUtils.ts
Lines 1604 to 1608 in 5e65276
What alternative solutions did you explore? (Optional)
Or we can check for iou report that will return false if the current user is not the manager and is not the owner of the iou report
App/src/libs/ReportUtils.ts
Lines 1604 to 1608 in 5e65276
For the expense report, we can add the check
isExpenseReporthereApp/src/libs/ReportUtils.ts
Line 6123 in 87c116b
or we can add a case in
canAddOrDeleteTransactionsfor the expense report that will return false if the current user isn't themanagerID(the submitter) of the expense reportOfstadC commentedon Jul 30, 2024
Assigned to me while I was OoO - reassigning
melvin-bot commentedon Jul 30, 2024
Triggered auto assignment to @zanyrenney (
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.41 remaining items
melvin-bot commentedon Sep 12, 2024
This issue has not been updated in over 15 days. @zanyrenney, @aldo-expensify, @dukenv0307, @nkdengineer eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
nkdengineer commentedon Sep 30, 2024
@zanyrenney The Issue was deployed to production 1 month ago. Should we process payment here
aldo-expensify commentedon Oct 1, 2024
The payment summary would be:
@dukenv0307 in C+ role: $250
@nkdengineer in contributor role: $250
Correct?
dukenv0307 commentedon Oct 2, 2024
@aldo-expensify I agree
nkdengineer commentedon Oct 2, 2024
@aldo-expensify I agree
zanyrenney commentedon Oct 4, 2024
payment summary
@dukenv0307 in C+ role: $250 paid via upwork
@nkdengineer in contributor role: $250 paid via upwork