Closed izarutskaya closed 1 month ago
Triggered auto assignment to @kevinksullivan (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.
We think this issue might be related to the #wave-control
Edited by proposal-police: This proposal was edited at 2024-09-02 20:14:01 UTC.
LHN - RBR stays for paid report
In all MoneyRequestPreview, MoneyReportView and LHN RBR we are showing RBR whenever there is a report or transaction violations without checking if the report is settled one https://github.com/Expensify/App/blob/e60b8210a1f5a2471d8aa9d84d0e461774b791d6/src/components/ReportActionItem/ReportPreview.tsx#L168-L170 https://github.com/Expensify/App/blob/e60b8210a1f5a2471d8aa9d84d0e461774b791d6/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx#L112 https://github.com/Expensify/App/blob/e60b8210a1f5a2471d8aa9d84d0e461774b791d6/src/components/LHNOptionsList/OptionRowLHNData.tsx#L40
We should only display RBR when violations exist if the iouReport is not settled (or not approved if we choose to do so).
Therefore, in all the cases listed above we need to add a condition of !ReportUtils.isSettled(
for both transaction and report violations. We can centralize the code by creating new functions to add these condition or we can update all TransactionUtils.hasViolation
, ReportUtils.hasReportViolations
and ReportUtils.hasViolations
to check for !isSettled
of the linked iou report.
@kevinksullivan Whoops! This issue is 2 days overdue. Let's get this updated quick!
Job added to Upwork: https://www.upwork.com/jobs/~021832065922256660213
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mkhutornyi (External
)
@kevinksullivan, @mkhutornyi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Hm, I'm curious for where this regressed as I'm sure it has been discussed before. CC: @JmillsExpensify @cead22
Moving to #wave-control project anyway, as a violations bug.
@FitseTLT thanks for the proposal. Are you able to find offending PR as I am pretty sure this used to work before.
@FitseTLT thanks for the proposal. Are you able to find offending PR as I am pretty sure this used to work before.
I didn't get in FE but of course in some cases when you pay a report the backend removes the violation in which case the RBR disappears so my thought was to implement a shield in FE code (in case the BE doesn't remove) same like we do in shouldDisplayTransactionThreadViolations
here
https://github.com/Expensify/App/blob/fc33ac1ac35248ecf888bb8d4e8e04b5e72cc56e/src/libs/ReportUtils.ts#L5897-L5899
Looping in another BZ member as I am going OOO
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.
We fixed similar issues in the past: https://github.com/Expensify/App/issues/34548 https://github.com/Expensify/App/issues/45230 They were in transaction threads.
This time, the issue is happening on single-transaction expense report
@FitseTLT can you please share test branch?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@FitseTLT's proposal looks good to me. 🎀👀🎀 C+ reviewed
Triggered auto assignment to @marcochavezf, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@FitseTLT from what I understand, the functions you mentioned in the proposal have never had code to check if a report is settled, so that check has to exist somewhere ele, and I think it works for some cases. Can you share where that check is, and why it works for some cases and not others?
Can you share where that check is, and why it works for some cases and not others?
@cead22 the only FE check we are including is for transaction thread violations here https://github.com/Expensify/App/blob/fc33ac1ac35248ecf888bb8d4e8e04b5e72cc56e/src/libs/ReportUtils.ts#L5897-L5899 But the inconsistency for other cases comes from the BE: sometimes the BE clears all the violations (transactionViolations and reportViolations) on payment and sometimes it doesn't.
If the backend doesn't clear the violations, and they show when the report is settled, then we're going through a flow that doesn't go through the code you linked. What flow is that?
Can you share the flows for which the backend isn't updating violations correctly?
@marcochavezf @OfstadC @kevinksullivan @mkhutornyi 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!
If the backend doesn't clear the violations, and they show when the report is settled, then we're going through a flow that doesn't go through the code you linked. What flow is that?
Can you share the flows for which the backend isn't updating violations correctly?
Ok @cead22 the flow is here in report preview https://github.com/Expensify/App/blob/e60b8210a1f5a2471d8aa9d84d0e461774b791d6/src/components/ReportActionItem/ReportPreview.tsx#L168-L170 and here in money request preview https://github.com/Expensify/App/blob/e60b8210a1f5a2471d8aa9d84d0e461774b791d6/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx#L112 Here is a demo vid: after paying the RBR remains and when clearing cache the RBR will disappear from report preview but after opening the transactions the RBR reappears because the transactionViolations are fetched by then.
https://github.com/user-attachments/assets/c27fcca0-1295-4d87-b7cf-1f10c6afd88f
@marcochavezf, @OfstadC, @kevinksullivan, @mkhutornyi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
From @nkdengineer in https://github.com/Expensify/App/issues/48397#issuecomment-2362825011
@cead22 I think we should clear the hold violation in optimistic data if we paid full instead of adding !isSettled condition.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@FitseTLT thanks for that
@JmillsExpensify did I get this right or has this changed from what I remember?
@marcochavezf, @OfstadC, @kevinksullivan, @mkhutornyi Still overdue 6 days?! Let's take care of this!
@marcochavezf, @OfstadC, @kevinksullivan, @mkhutornyi Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@marcochavezf @OfstadC @mkhutornyi this issue is now 4 weeks old, please consider:
Thanks!
@marcochavezf, @OfstadC, @mkhutornyi Whoops! This issue is 2 days overdue. Let's get this updated quick!
@marcochavezf, @OfstadC, @mkhutornyi Huh... This is 4 days overdue. Who can take care of this?
From this comment, seems part of the behavior is expected. Closing it out for now, but we can re-open if it's reported again as an issue
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: v9.0.27-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: https://expensify.testrail.io/index.php?/cases/view/3266257 Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team
Action Performed:
Precondition: control ws exist with enabled categories, Tags and Taxes. Enable toggle 'Members must categorize/tag all expenses'.
Expected Result:
Employee: report doesn't have a RBR in the LHN and isn't pinned.
Actual Result:
Employee: report still have a RBR in the LHN and isn't pinned.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
https://github.com/user-attachments/assets/4ed69491-f663-4e83-b488-26731680c9d5
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mkhutornyi