-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix - Don't show RBR on the LHN for transaction threads with violations if the report has already been reimbursed/settled #37767
Fix - Don't show RBR on the LHN for transaction threads with violations if the report has already been reimbursed/settled #37767
Conversation
Code looks good. I'll wait for @situchan to review before approving |
Hi, what's the ETA on this? Eager to get it done! |
completing today |
src/libs/SidebarUtils.ts
Outdated
let shouldShowViolations = false; | ||
if (hasViolations && parentReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU) { | ||
const {IOUReportID} = parentReportAction?.originalMessage ?? {}; | ||
shouldShowViolations = !ReportUtils.isSettled(IOUReportID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cead22 should we show RBR when approved but not reimbursed?
ReportUtils
has isReportApproved
(statusNum = APPROVED) and isSettled
(statusNum = REIMBURSED) methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
- On the LHN only to the user that made the request
- On the money request view, to all users that have access
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the LHN only to the user that made the request
🟢
On the money request view, to all users that have access
I am not seeing violation on payer side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not seeing violation on payer side
That's probably because RequestMoney doesn't return violations, and doesn't push them to the relevant users either. There's another issue that OpenReport only returns violations to the user that made the money request.
I submitted a backend fix for the second issue, and I'm working on a backend solution for the first as well
@FitseTLT please update Tests / QA step as per #37767 (comment). |
By the way, I know and the reason I said |
@FitseTLT though RBR doesn't show on LHN, it looks as if pinned. It should be below pinned items |
@FitseTLT bump on above. |
Fixed 👍 |
@situchan can u please give it a priority as it is considered a highly requested issue |
Yes, can't wait for this one. |
src/libs/ReportUtils.ts
Outdated
@@ -4048,7 +4048,8 @@ function doesTransactionThreadHaveViolations(report: OnyxEntry<Report>, transact | |||
if (report?.stateNum !== CONST.REPORT.STATE_NUM.OPEN && report?.stateNum !== CONST.REPORT.STATE_NUM.SUBMITTED) { | |||
return false; | |||
} | |||
return TransactionUtils.hasViolation(IOUTransactionID, transactionViolations); | |||
|
|||
return TransactionUtils.hasViolation(IOUTransactionID, transactionViolations) && !isSettled(IOUReportID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this call to isSettled
outside of this function like in the proposal? I don't think it belongs in this function
revert pr #38081 has made the last change unnecessary. I will revert it. |
@cead22 I have a question on
Except the one we are dealing with here (showing RBR of LHN) there are two instances we use App/src/libs/OptionsListUtils.ts Lines 1449 to 1450 in 0e9bd7f
Lines 83 to 84 in 0e9bd7f
and in both case we pass it to shouldReportBeInOptionList but in shouldReportBeInOptionList violations will only affect the result when the transaction(report) is not settled we alread have isSettled Check hereLines 4225 to 4228 in e9c112a
And in fact the appearance of settled report along with the pinned ones bug (the one @situchan ) reported was caused by the lack of isSettled check on here (but now it is reverted) Lines 95 to 97 in 3f7a361
Questions:
Lines 749 to 752 in 0e9bd7f
|
Discussing this with @JmillsExpensify, I think we want to do something slightly different, and I'll update the issue to reflect this. Let me make sure I got the requirements right and I'll update here |
@FitseTLT sorry for the delay
I'm good with adding a function like you suggest
ReportUtils.isSettled sounds good 👍 |
@situchan ready for your review! |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just address Carlos's feedback
@cead22 All comments addressed and changes test well 👍 |
@cead22 looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Tests pass, but performance tests are running, but they take a long time and will alert if it fails. This wasn't an emergency change |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/cead22 in version: 1.4.56-0 🚀
|
Can you also share the transaction thread reportIDs (if you're looking at the money request page, where you can edit category/tag/etc, it's the ID in the URL) |
@cead22 From the explanation #37767 (comment) It looks like the issue is that the iouReport haven't been loaded to onyx but unfortunately for now when iou Report is approved/settled we are not setting the transaction thread reports statusNum so to determine whether it is settled we need to depend on the status of the iou report which is another report so whenever it is not in onyx this cases can occur. |
Thanks @FitseTLT, let me know if you find a way to reproduce, since I haven't been able to
|
Here are some log requestIDs Sasha pulled from the Network tab from when I clicked on one of the report chats:
|
I tried disabling tags as well, and still couldn't repro |
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.56-8 🚀
|
parentReportAction: OnyxEntry<ReportAction>, | ||
): boolean { | ||
const {IOUReportID} = (parentReportAction?.originalMessage as IOUMessage) ?? {}; | ||
if (isSettled(IOUReportID)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Later, we added more condition (approved reports, not only reimbursed/settled) to hide RBR on the LHN for transaction threads.
#45230
Details
Fixed Issues
$ #34548
PROPOSAL: #34548 (comment)
Tests
Precondition:
Make sure you're on the violations beta
On the collect workspace set category as required
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mp4
Android: mWeb Chrome
android.web.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.web.mp4
MacOS: Chrome / Safari
2024-03-20.23-36-57.mp4
MacOS: Desktop
2024-03-20.23-40-52.mp4