Open lanitochka17 opened 3 months ago
Triggered auto assignment to @miljakljajic (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.
@miljakljajic 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
We think that this bug might be related to #wave-collect - Release 1
@miljakljajic Whoops! This issue is 2 days overdue. Let's get this updated quick!
Job added to Upwork: https://www.upwork.com/jobs/~01e26750961886bca4
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (External
)
@jjcoffee, @miljakljajic Huh... This is 4 days overdue. Who can take care of this?
Waiting for proposals!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@jjcoffee @miljakljajic this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@miljakljajic Maybe we should try bumping the price to get more eyes on this?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
This isn't getting any attention, let's bump the price @miljakljajic
@jjcoffee, @miljakljajic Huh... This is 4 days overdue. Who can take care of this?
reconfirming the expected outcome here - I'm not clear on why the employee would see the Pay with Expensify option
@miljakljajic I think the issue is that Pay with Expensify
should not appear for the employee at all, but it does appear once the admin disconnects the bank account. @lanitochka17 can you confirm?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@jjcoffee @miljakljajic this issue is now 4 weeks old, please consider:
Thanks!
@jjcoffee, @miljakljajic Eep! 4 days overdue now. Issues have feelings too...
@miljakljajic Should we bump the price to get more eyes on this?
Hey! I'm Eto Olei from Callstack. I will like to look into this issue. Please assign it to me. Thanks!
Thank you @teneeto! I will
📣 @jjcoffee 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
Hi @miljakljajic, FYI I have an unexpected review that needs my attention. Will come back to this in no time.
@teneeto, @jjcoffee, @miljakljajic Whoops! This issue is 2 days overdue. Let's get this updated quick!
Not overdue - just waiting for @teneeto to pick this back up.
Hi @miljakljajic, I'm back to looking into this.
Thank you!
@teneeto, @jjcoffee, @miljakljajic Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Just waiting for @teneeto! :pray:
Hey hey! I'm still investigating and have to dig in a little.
@teneeto, @jjcoffee, @miljakljajic Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Hya, I' still on this and just a tiny bit more to check and I'll post findings.
Sweet, thanks for the update!
Triggered auto assignment to @twisterdotcom (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.
Assigning this over to another BZ member as I'm heading out on parental leave.
@twisterdotcom - we are waiting for an update from @teneeto at Call stack before moving forward. Thank you!
O yea, still checking and will share updates by EOD.
@twisterdotcom, @teneeto, @jjcoffee Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Any updates @teneeto?
@twisterdotcom, I suspect this to be BE - all checks on FE passes so far. I'm just looking at one more thing. I'm not done. Once I can be sure I can share my thoughts, My apologies for not posting updates as promised earlier. Thanks.
I managed to track the issue all the way down to this condition here: https://github.com/teneeto/Expensify/blob/dcf1a0cac762ef658ebfa8f692331f04828d6716/src/libs/ReportUtils.ts#L1640-L1649
Each time a workspace bank account is removed, !policy?.achAccount?.reimburser
is opimistically updated which sets that condition to true and then causing the settlement button to show. This shouldn't even be a problem. The main issue there is, the conditions there don't fall through as it should at least for this operation.
I'm still looking at how best this could be fixed - which i don't expect, should take any longer before i raise a PR.
@twisterdotcom, @teneeto, @jjcoffee Whoops! This issue is 2 days overdue. Let's get this updated quick!
@twisterdotcom @jjcoffee a PR is raised here: https://github.com/Expensify/App/pull/49969
Here are my thoughts on my solution and possible alternatives (if needed).
On these lines:
https://github.com/teneeto/Expensify/blob/dcf1a0cac762ef658ebfa8f692331f04828d6716/src/libs/ReportUtils.ts#L1641 and https://github.com/teneeto/Expensify/blob/dcf1a0cac762ef658ebfa8f692331f04828d6716/src/libs/ReportUtils.ts#L1645, we are doing condition to check for payer and depending on whether or not a bank account is connected, those conditions are triggered. The issue is when a bank account is disconnected, the second condition is not immediately triggered because policy?.reimbursementChoice
is not immediately or optimistically updated when the bank account is disconnected - except you force a page reload or the endpoint is re-triggered.
I found another field policy?.reimbursement?.choice?.reimbursementChoice
which updates as expected. policy?.reimbursementChoice
is now used as a fallback.
const reimbursementChoice = policy?.reimbursement?.choice?.reimbursementChoice ?? policy?.reimbursementChoice;
We can find out why policy?.reimbursementChoice
doesn't optimistically update, fix it and then use it again.
The video below shows a log of policy objects and the variation in the reimbursement
choice fields after the bank account is disconnected.
https://github.com/user-attachments/assets/b05a9257-143d-4ebd-bb4c-149be7526b78
@teneeto Thanks for the investigation and for the detailed write-up! I just need to clarify a few points before proceeding.
when a bank account is disconnected, the second condition is not immediately triggered
Are you saying that once the bank account is disconnected, the reimbursementChoice
should be CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL
?
I think the main confusion for me here is that the employee shouldn't be seeing the pay button at all as they are not the "reimburser" (in either condition). So it seems like once the bank account is disconnected, the employee is treated as the reimburser for some reason.
Yes, reimbursementChoice
should be CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL
. For the second point, I can't say I'm 100% sure of what the flow should be but yes, that contributed to the issue as well, I also stated it here: https://github.com/Expensify/App/issues/46738#issuecomment-2378746230. Either way, it involves the values being updated from BE.
Overall, the conditions with reimbursementChoice
are the parent issue. If that is solved properly then it handles the confusing part as well.
That makes sense, thanks! I guess policy?.achAccount?.reimburser
is getting removed along with the bank account which is another part of the issue.
I'm a bit unsure on why there are two fields for reimbursementChoice
that you mention in your solution, so I'm gonna get an engineer assigned to make sure it's okay to switch to.
:ribbon::eyes::ribbon: C+ reviewed
Triggered auto assignment to @srikarparsi, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
The RCA here makes sense to me. I do think we should go with the alternate solution listed though since we already store reimbursementChoice and don't think we need a new variable for that data.
Also, I don't think we should ever show the pay button to regular employees (not admins, managers...). @rlinoz, do you know why we show the settlement button in this line if reimburser is empty (and the report is approved)?
I think it comes from here actually https://github.com/Expensify/App/pull/38253, but I am not sure what we were fixing, maybe @luacmartins remembers
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.16-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team
Action Performed:
Precondition:
Expected Result:
"Pay with Expensify" button will not appear on expense preview on employee end after admin has disconnected bank account
Actual Result:
"Pay with Expensify" button shows up on expense preview on employee end after admin has disconnected bank account. When clicking on the expense preview and returning to main chat, the button disappears
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/user-attachments/assets/ee48cf85-86b5-410f-a14d-a12c851cc1b4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @teneeto