-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 RBR transaction thread is disappearing from the LHN when navigating to another chat v2 #43502
Conversation
…ng to another chat v2
src/libs/ReportUtils.ts
Outdated
@@ -1422,7 +1422,7 @@ function isOneTransactionReport(reportID: string): boolean { | |||
function isOneTransactionThread(reportID: string, parentReportID: string): boolean { | |||
const parentReportActions = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReportID}`] ?? ([] as ReportAction[]); | |||
const transactionThreadReportID = ReportActionsUtils.getOneTransactionThreadReportID(parentReportID, parentReportActions); | |||
return reportID === transactionThreadReportID; | |||
return reportID?.toString() === transactionThreadReportID?.toString(); |
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.
Shouldn't both of these already be strings?
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 checked and found out that one is a number, and the other one is a string. This bug is mentioned here
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.
Hmm I've asked for clarification here on what's best to do. Ideally this would be fixed in the BE first, but of course that can take some time.
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.
@jjcoffee So should we revert this fix return reportID?.toString() === transactionThreadReportID?.toString()
from FE, then wait until BE fixes it?
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.
I put up a PR to fix the type on the BE. We should be able to remove the cast to string once that's merged/deployed
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-app-2024-06-24_12.34.51.mp4Android: mWeb Chromeandroid-chrome-2024-06-24_11.52.36.mp4iOS: Nativeios-app-2024-06-24_13.32.17.mp4iOS: mWeb Safariios-safari-2024-06-24_13.20.52.mp4MacOS: Chrome / Safaridesktop-chrome-2024-06-12_12.29.07.mp4MacOS: Desktopdesktop-app-2024-06-24_11.14.38.mp4desktop-app-2024-06-24_11.17.07.mp4 |
This comment was marked as resolved.
This comment was marked as resolved.
|
Hmm I would expect there to be some RBR in the LHN (just not multiple). Are you saying that there's no way to resolve this without reintroducing the issue with the header not linking straight to the workspace? |
I am working on it. Will update in a few hours. |
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.
Thanks @tienifr. Please let us know once the PR is ready for review again.
@jjcoffee PR is ready to review again. Now, we display RBR in the LHN in case of oneTransactionReport: |
src/libs/SidebarUtils.ts
Outdated
result.brickRoadIndicator = hasErrors || hasViolations ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : ''; | ||
const oneTransactionThreadReportID = ReportActionsUtils.getOneTransactionThreadReportID(report.reportID, reportActions); |
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 think we could do with an explanatory comment here.
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.
+1
const shouldDisplayViolations = canUseViolations && ReportUtils.shouldDisplayTransactionThreadViolations(fullReport, transactionViolations, parentReportAction); | ||
|
||
let shouldDisplayViolations = canUseViolations && ReportUtils.shouldDisplayTransactionThreadViolations(fullReport, transactionViolations, parentReportAction); | ||
const oneTransactionThreadReportID = ReportActionsUtils.getOneTransactionThreadReportID(reportID, reportActions); |
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.
A comment here would be nice!
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.
@tienifr Bump on this 🙏
Looks like there are BE issues so I don't think I'll be able to test this today, will try again tomorrow! |
What issues did you have? |
@luacmartins I couldn't login, the error referred to some database connectivity issues. Seems fine now! |
@luacmartins I'm starting to wonder if we should fix the problem with one transaction reports in a separate issue, as the current behaviour on staging is that an RBR doesn't even show in the LHN for a one transaction report that has a violation. |
We have a backend PR to fix this when requesting money. So this should be solved soon. |
hmm this seems like a bug to me. We should show the GBR/RBR in the LHN if the user has to take an action, which from your screenshot it seems like they need to approve the report. |
|
Yea, maybe we should hold on the API PR and check the state of this bug after. |
@luacmartins Sure! I've retested and it looks like there's no RBR in the case of a violation on an expense report with a single transaction. In this case the expense report disappears from the LHN once you tap away from it. This is expected behaviour for the app's current state IMO (the same happens on staging) and would be out of scope for this PR to fix. It works normally if there's an RBR displaying in the LHN, e.g. from a BE error in response to approving the expense. desktop-chrome-2024-06-27_13.33.33.mp4 |
@jjcoffee I agree that the behavior shown in your video is expected. In that case, is there anything left to do here? Or should we close this PR? |
|
Ah you're right. Plan sounds good to me, let's do it! |
@jjcoffee I updated PR. Tested and it works properly |
@luacmartins Should we remove "HOLD Auth #11324" in PR's title? |
Removed the hold. Ready for review! |
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.
Retested and it works well!
✋ 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/luacmartins in version: 9.0.4-0 🚀
|
🚀 Cherry-picked to staging by https://github.com/tgolen in version: 9.0.4-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.5-13 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.6-8 🚀
|
Details
Fixed Issues
$ #36778
$ #43238
PROPOSAL: #36778 (comment)
Tests
Test case 1: Make sure this PR fix the bug #36778:
Test case 2: Make sure this PR fix the bug #43238:
Test case 3: Make sure this PR fix the bug #43252:
Precondition:
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 methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
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
Screen.Recording.2024-06-12.at.00.47.01.mov
Android: mWeb Chrome
Screen.Recording.2024-06-12.at.00.48.52.mov
iOS: Native
Screen.Recording.2024-06-12.at.00.56.33.mov
iOS: mWeb Safari
Screen.Recording.2024-06-12.at.00.45.51.mov
MacOS: Chrome / Safari
output.mp4
Screen.Recording.2024-06-12.at.00.34.46.mov
MacOS: Desktop
Screen.Recording.2024-06-12.at.00.42.15.mov