Closed izarutskaya closed 1 month ago
Triggered auto assignment to @adelekennedy (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.
Triggered auto assignment to @marcaaron (DeployBlockerCash
), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
:wave: Friendly reminder that deploy blockers are time-sensitive β± issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
We think this issue might be related to the #wave-control
I'd say this isn't a blocker since advanced approvals in NewDot are quite new - I'll get @rushatgabhane and @mananjadhav to look into this ASAP (tomorrow hopefully) π - see https://github.com/Expensify/App/pull/44940#issuecomment-2284943045
@marcaaron, @adelekennedy Whoops! This issue is 2 days overdue. Let's get this updated quick!
@Beamanator any updates on this from @mananjadhav and @rushatgabhane? Should I assign them here?
I can take a look at this tomorrow.
@marcaaron, @adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@mananjadhav Any update?
@mananjadhav @marcaaron @adelekennedy this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@mananjadhav, @marcaaron, @adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@mananjadhav were you able to get to this one?
I couldn't get to this one. I'll try to get to this by tomorrow.
Great! If you don't have time we'll reassign to get it moving forward!
@adelekennedy I haven't got time to take a look at the issue. We can open up for External contributors and I can help with the review if needed.
Job added to Upwork: https://www.upwork.com/jobs/~01682c8c3ddb795078
Current assignee @mananjadhav is eligible for the External assigner, not assigning anyone new.
@mananjadhav, @marcaaron, @adelekennedy Whoops! This issue is 2 days overdue. Let's get this updated quick!
Still seeing if someone has time to pick this up
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
Upwork job price has been updated to $500
Let's get some action on this one.
Edited by proposal-police: This proposal was edited at 2024-09-06 19:07:57 UTC.
Approve button not disappear after approving report offline if advanced approval set
When there is an advanced approval chain the report status will not change to approved status https://github.com/Expensify/App/blob/812fc316a007b711d62a986582d19440c2c1dad8/src/libs/actions/IOU.ts#L6922 but instead stays at submitted and only the manager id will be changed to the next approver but we are not updating the managerID of the expense report optimistically here https://github.com/Expensify/App/blob/812fc316a007b711d62a986582d19440c2c1dad8/src/libs/actions/IOU.ts#L6938-L6948
We need to set the manager id optimistically to next approver id which we are already finding to build our next step
function getNextApproverAccountID(report: OnyxEntry<Report>) {
const {policyID = '', ownerAccountID = -1} = report ?? {};
const policy = PolicyUtils.getPolicy(policyID);
const approvalChain = ReportUtils.getApprovalChain(policy, ownerAccountID, report?.total ?? 0);
const submitToAccountID = PolicyUtils.getSubmitToAccountID(policy, ownerAccountID);
if (approvalChain.length === 0) {
return submitToAccountID;
}
const nextApproverEmail = approvalChain.length === 1 ? approvalChain[0] : approvalChain[approvalChain.indexOf(currentUserEmail) + 1];
if (!nextApproverEmail) {
return submitToAccountID;
}
return getAccountIDsByLogins([nextApproverEmail])[0];
}
const managerID = isLastApprover(approvalChain) ? expenseReport?.managerID : getNextApproverAccountID(expenseReport) ?? expenseReport?.managerID;
or simply we can also do
const currentUserApprovalIndex = approvalChain.indexOf(currentUserEmail);
const managerID = isLastApprover(approvalChain) || currentUserApprovalIndex === -1 ? expenseReport?.managerID : getAccountIDsByLogins([approvalChain[currentUserApprovalIndex + 1]])[0];
and set the managerID of the expense report optimistically here https://github.com/Expensify/App/blob/812fc316a007b711d62a986582d19440c2c1dad8/src/libs/actions/IOU.ts#L6942-L6946
managerID,
@mananjadhav are you able to review proposals here or should we reassign?
i can take a look ^
Iβll review in an hour.
Reviewing the proposal now.
@FitseTLT I understand adding the managerID to the optimistic steps but when I was trying to access the props last time this is what I found.
{
"isCurrentUserManager": true,
"isOpenExpenseReport": false,
"isApproved": false,
"iouSettled": false,
"isArchivedReport": false
}
Essentially the canApproveIOU
was returning true
and if you see currentManagerID
is already true based on the iouReport.managerID
. So I am not sure how this is getting fixed. Can you please clarify?
And I tried setting the managerID with the currentUserApprovalIndex
logic you posted and it didn't work for me.
Essentially the canApproveIOU was returning true and if you see currentManagerID is already true based on the iouReport.managerID. So I am not sure how this is getting fixed. Can you please clarify?
Yeah. @mananjadhav This is exactly the reason my solution fixes it(BTW I have already tested my solution works perfectly). The reason the approve button exists after pressing the approve button is because the current user is still the manager. There are two cases for the approve action btw:
managerID
of the iou report will be set to the next approver and the approve button will disappear because the current user will not be manager anymore (isCurrentUserManager
is false).@mananjadhav @marcaaron @adelekennedy this issue is now 4 weeks old, please consider:
Thanks!
@FitseTLT Do you mind uploading the video of the fix you've applied? I'll take a look again at my end too.
Precondition: create a control workspace
This is an advanced approvals bug with the prerequisite being a control workspace, moving to #wave-control.
Thanks for sharing the branch. I tested the flow and it worked fine. I was attempting a different change from yours and hence it didn't work for me.
I think @FitseTLT's proposal looks good to me.
π π π C+ reviewed.
Current assignee @marcaaron is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.
π£ @FitseTLT π 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 π
PR is in progress
Deployed to prod today!
@adelekennedy this should be ready for payout. I couldn't exactly pinpoint the offending PR. Closest I think this should've been a part of https://github.com/Expensify/App/pull/44940/files.
Meanwhile I don't know if a regression test exists for the whole advance approval workflow. @adelekennedy can you confirm this? I think it should exists and in that case we don't need a regression test here.
Payouts due:
Upwork job is here.
@adelekennedy I received the payment Thx!
is the issue still live?
π£ @AngadManroy! π£ 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:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
$250 approved for @mananjadhav
@garrettmknight The amount is $500.
If you havenβt already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.19.2 Reproducible in staging?: Y Reproducible in production?: N Found when validating PR : https://github.com/Expensify/App/pull/44940 Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team
Action Performed:
Precondition: create a control workspace, set "Manually approve all expenses" over to $10 and set advanced approval in OD:
Expected Result:
The approve button dsiappears
Actual Result:
The approve button is still displayed until user returns online
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
https://github.com/user-attachments/assets/5b3f27ae-2414-42d4-9b3b-e62419645ce4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @