Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.5k stars 2.85k forks source link

[$500] Expense - Green dot disappears from LHN when paying one out of many unpaid reports #34767

Open lanitochka17 opened 9 months ago

lanitochka17 commented 9 months ago

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: 1.4.27-1 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:

Action Performed:

Precondition: There is a Collect workspace on Old Dot with admin and employee pre-steps to have multiple reports for testing -

  1. [Employee] Create a manual request in the workspace chat and submit it
  2. [Employee] Create another manual request and submit it
  3. {Admin] Go to workspace chat with employee
  4. [Admin] Pay the second submitted report (submitted in Step 2)
  5. Note that the LHN does not show green dot
  6. [Admin] Click on the preview of first submitted report (Step 1) and return to the main chat

Expected Result:

In Step 4, green dot should still appear for the workspace chat in LHN because there is still unpaid report

Actual Result:

In Step 4, LHN for the workspace chat with unpaid report does not show green dot after paying one of the reports. It only shows green dot when revisiting main chat from the expense report

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/9fa5d1b7-103b-457a-8c67-b280b0ddeba8

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fffa54d6d963be62
  • Upwork Job ID: 1748072099859210240
  • Last Price Increase: 2024-01-18
Issue OwnerCurrent Issue Owner: @roryabraham
melvin-bot[bot] commented 9 months ago

Job added to Upwork: https://www.upwork.com/jobs/~01fffa54d6d963be62

melvin-bot[bot] commented 9 months ago

Triggered auto assignment to @peterdbarkerUK (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] commented 9 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts (External)

lanitochka17 commented 9 months ago

#wave6-collect-submitters

tienifr commented 9 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

In Step 4, LHN for the workspace chat with unpaid report does not show green dot after paying one of the reports. It only shows green dot when revisiting main chat from the expense report.

What is the root cause of that problem?

We're setting the hasOutstandingChildRequest to false immediately here when paying money request, without checking whether there're still more outstanding child requests that are unpaid.

What changes do you think we should make in order to solve the problem?

Check that there're no other outstanding child requests first before setting hasOutstandingChildRequest to false in optimistic data above.

There're a couple of ways to do this:

    • Fix the back-end to return hasOutstandingChildRequest: true properly for the unpaid IOU report (currently it's returning hasOutstandingChildRequest: false even though those IOU reports are unpaid)
    • Then in here, check the list of IOU report that corresponds to the report preview report actions in the chat report, and only set hasOutstandingChildRequest to false if no other IOU reports have hasOutstandingChildRequest: true
  1. Or we can use conditions similar to this to check if the REPORTPREVIEW needs to be paid (instead of using the hasOutstandingChildRequest on the IOU report)

What alternative solutions did you explore? (Optional)

We can add a back-end field outstandingChildRequestCount that is the total count of outstanding child requests (similar idea to the childVisibleActionCount of the reportAction). When we pay the request, in optimistic data we reduce the outstandingChildRequestCount by 1, and only set hasOutstandingChildRequest to false if after paying this request, the outstandingChildRequestCount becomes 0.

allroundexperts commented 9 months ago

I think Option 2 from @tienifr's proposal should work fine and be inline with the code that we are already using.

🎀 👀 🎀 C+ reviewed

melvin-bot[bot] commented 9 months ago

Triggered auto assignment to @roryabraham, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

peterdbarkerUK commented 9 months ago

Confirming priority in slack

mountiny commented 9 months ago

@roryabraham I believe to implement this properly, we would need to create App version of this Auth method and make sure we use this in backend when the report is reimbursed to update the GBR correctly.

roryabraham commented 9 months ago

I believe to implement this properly, we would need to create App version of this Auth method and make sure we use this in backend when the report is reimbursed to update the GBR correctly.

we do have ReportUtils::requiresAttentionFromCurrentUser which seems about the same – I wish these didn't have to be re-implemented and we could just have some shared logic in a C++ function that we could use in both places, but that's probably out-of-scope for this issue...

Fix the back-end to return hasOutstandingChildRequest: true properly for the unpaid IOU report (currently it's returning hasOutstandingChildRequest: false even though those IOU reports are unpaid)

This sounds like it needs to be fixed, regardless. I think I prefer @tienifr's solution #1. I'm happy to assign him, but he'll be blocked on the back-end change.

Now I'm starting to think more seriously about creating some shared C++ libs for non-trivial business logic like this that's very input/output oriented and needs to be kept in sync across layers. But as that would be a new pattern, we need to discuss it further.

Sorry I don't have a more decisive conclusion here just yet – it's very late for me so I want to look at this one more time with fresher eyes.

melvin-bot[bot] commented 9 months ago

@peterdbarkerUK, @allroundexperts, @roryabraham Eep! 4 days overdue now. Issues have feelings too...

allroundexperts commented 9 months ago

Hi @roryabraham! Just following up on above. Did you get a chance to look at this again with a fresh pair of eyes?

melvin-bot[bot] commented 8 months ago

@peterdbarkerUK @allroundexperts @roryabraham 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!

melvin-bot[bot] commented 8 months ago

Triggered auto assignment to @slafortune (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] commented 8 months ago

@slafortune, @allroundexperts, @roryabraham Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] commented 8 months ago

Current assignee @allroundexperts is eligible for the Internal assigner, not assigning anyone new.

roryabraham commented 8 months ago

Making this internal to implement @tienifr's proposed solution above, and adding this to wave7 as it's a bug for reimbursers.

roryabraham commented 8 months ago

We'll add Help Wanted back and hire @tienifr for the second half of solution number 1 of this proposal once the back-end change is made.

melvin-bot[bot] commented 8 months ago

@slafortune @allroundexperts @roryabraham this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

slafortune commented 8 months ago

Hey @roryabraham is there a link to the changes we're waiting on?

melvin-bot[bot] commented 8 months ago

@slafortune, @allroundexperts, @roryabraham Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

slafortune commented 8 months ago

I think while we wait, moving this to weekly works.

melvin-bot[bot] commented 8 months ago

@slafortune @allroundexperts @roryabraham this issue is now 4 weeks old and preventing us from maintaining WAQ. This should now be your highest priority. Please post below what your plan is to get a PR in review ASAP. Thanks!

roryabraham commented 8 months ago

Ah, sorry for the delayed update. I don't have a back-end PR up yet

melvin-bot[bot] commented 8 months ago

@slafortune, @allroundexperts, @roryabraham Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

roryabraham commented 8 months ago

Leaving some breadcrumbs for myself to follow:

melvin-bot[bot] commented 8 months ago

@slafortune, @allroundexperts, @roryabraham Huh... This is 4 days overdue. Who can take care of this?

roryabraham commented 8 months ago

No update right now, hopefully should be able to get this sorted this week though

melvin-bot[bot] commented 7 months ago

@slafortune, @allroundexperts, @roryabraham Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] commented 7 months ago

@slafortune, @allroundexperts, @roryabraham 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] commented 7 months ago

@slafortune, @allroundexperts, @roryabraham 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

roryabraham commented 7 months ago

no update, have been unable to prioritize anything other than NewDot deploy this week so far

melvin-bot[bot] commented 7 months ago

@slafortune, @allroundexperts, @roryabraham Eep! 4 days overdue now. Issues have feelings too...

roryabraham commented 7 months ago

Currently prioritizing getting the HybridApp build working again in https://github.com/Expensify/App/issues/36717

melvin-bot[bot] commented 7 months ago

@slafortune, @allroundexperts, @roryabraham Whoops! This issue is 2 days overdue. Let's get this updated quick!

slafortune commented 7 months ago

Added the retest label to make sure this is actually still an issue.

melvin-bot[bot] commented 7 months ago

@slafortune, @allroundexperts, @roryabraham Still overdue 6 days?! Let's take care of this!

slafortune commented 7 months ago

Will be retested this week

roryabraham commented 7 months ago

I've got a number of things I'm planning to prioritize over this:

then this will be next up. Hopefully that prioritization makes sense. If we need to, we can have someone else take over because I don't have a WIP PR up yet

mvtglobally commented 7 months ago

Issue is reproducible during KI retests.

In Step 4, LHN for the workspace chat with unpaid report does not show green dot after paying one of the reports

https://github.com/Expensify/App/assets/43995119/e8da101b-87b9-455e-afac-374024396064

melvin-bot[bot] commented 6 months ago

This issue has not been updated in over 14 days. @slafortune, @allroundexperts, @roryabraham eroding to Weekly issue.

roryabraham commented 6 months ago

no update, currently prioritizing fires, deploy blockers, and (soon) CP-to-prod

roryabraham commented 5 months ago

No update, was focused on May 1st issue then this important app reliability problem

slafortune commented 5 months ago

@roryabraham I'll be on vacation until June 4th - I'm going to leave this assigned to myself since it seems this is held up on you and no payment will be required before I am back. If something changes, please remove me and readd the BZ label.

melvin-bot[bot] commented 5 months ago

This issue has not been updated in over 15 days. @slafortune, @allroundexperts, @roryabraham 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!

slafortune commented 4 months ago

Hey @roryabraham do you have a quick update on this?

slafortune commented 4 months ago

@roryabraham should this be left to weekly?

melvin-bot[bot] commented 4 months ago

This issue has not been updated in over 15 days. @slafortune, @allroundexperts, @roryabraham 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!

trjExpensify commented 2 months ago

I'm curious if this has been fixed along the way in GBR improvements?

trjExpensify commented 2 months ago

If not, let's get it done as we push new sign-ups into NewDot more aggressively.