-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD for payment 2024-12-16] [$250] Web - Header - Approve button appears briefly when it shouldn't #52669
Comments
Triggered auto assignment to @jliexpensify ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Web - Header - Approve button appears briefly when it shouldn't What is the root cause of that problem?For example we have 3 users: A (admin), B, and C Admin: Add new approval workflow (from B and approval B), the BE will set the Admin: Enable new rule to prevent self-approvals "Prevent self-approvals", it will block us from submit/approve the expense if the expense is from user B B: Submit new expense and open the expense, the submit button inside report header will be disabled because we enable the "Prevent self-approvals" option inside the Rules page Admin: Inside the approval workflow, change the approval to another user (C) B: The submit/approve button become clickable because the approval is not equal to submitter B: If we go offline mode, then submit the expense the approve button will show because this check return true Line 6739 in 9774032
Line 6757 in 9774032
It's because the expense manager id is equal to the current account id (B), it's because after the admin change the approver inside the approval workflow to another user C, the BE doesn't update the managerID So if we go online mode the BE returns the correct managerID (user C) because inside the params we pass the correct managerID (user C) Lines 7235 to 7241 in 9774032
and we can also see inside the report header nextstep message returning the correct approval name because we're getting the approval account id from the policy instead of using the managerID Lines 6846 to 6860 in 9774032
What changes do you think we should make in order to solve the problem?There are several options to solve this issue
managerID: PolicyUtils.getSubmitToAccountID(policy, expenseReport) ?? reportOnyx?.managerID
const managerID = managerID: PolicyUtils.getSubmitToAccountID(policy, iouReport) ?? iouReport?.managerID ?? -1;
const isCurrentUserManager = managerID === userAccountID;
...
return isCurrentUserManager && !isOpenExpenseReport && !isApproved && !iouSettled && !isArchivedReport && !isTransactionBeingScanned;
What alternative solutions did you explore? (Optional)instead of using Lines 6846 to 6860 in 9774032
|
I can reproduce this one, I think it'll be a #quality issue? |
Job added to Upwork: https://www.upwork.com/jobs/~021858267603397515787 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann ( |
Edited by proposal-police: This proposal was edited at 2024-11-21 03:23:38 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.When clicking the submit button, the approve button briefly appears. What is the root cause of that problem?
Lines 7148 to 7149 in 9774032
, so the approve button is still displayed optimistically with the disable state because the
is
is What changes do you think we should make in order to solve the problem?
and then revert the
should be fixed in BE side as well. What alternative solutions did you explore? (Optional)We also can set managerID to approvalChain[0] when submitting reports |
@daledah What do you think if we always set the first approver ID to managerID when submitting a report? Another question why do we need to revert the managerID in the failureData? |
@DylanDylann I updated my proposal to cover your suggestion
Agree. I will remove it in the PR |
@NJ-2020 Thanks for your contribution with detailed RCA. I notice that you suggest 4 solutions with a brief and sketchy explanation for each one. I think we should only propose solutions that you think are the best and give more detail about that. @daledah's proposal looks good to me 🎀 👀 🎀 C+ Reviewed |
Triggered auto assignment to @francoisl, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @daledah 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@francoisl, @jliexpensify, @DylanDylann, @daledah Eep! 4 days overdue now. Issues have feelings too... |
@daledah Could you give an ETA? |
@DylanDylann I'll open the PR in a couple hours. |
@DylanDylann PR is ready. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.72-1 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 2024-12-16. 🎊 For reference, here are some details about the assignees on this issue:
|
@DylanDylann @jliexpensify @DylanDylann 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] |
Payment Summary
|
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test ProposalPrecondition:Admin create a WS and add employee A and B Test:
Do we agree 👍 or 👎 |
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.0.63-3
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
When clicking the submit button, the approve button should not appear at any point.
Actual Result:
When clicking the submit button, the approve button briefly appears.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6667262_1731770324152.1.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @jliexpensifyThe text was updated successfully, but these errors were encountered: