-
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
Debug Mode - "Has RBR" is not shown for report that has RBR in LHN #50468
Debug Mode - "Has RBR" is not shown for report that has RBR in LHN #50468
Conversation
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
All that remains from my side is to add missing screenshots and three test cases for I'll let you know when I'm done, which should be tomorrow 😄 |
…-visible-in-lhn-debug-section
@pac-guerreiro Kindly bump |
Sorry for the delay, I just added the unit test cases for I also added the screenshots in the meantime. Can you give another review and let me know if I missed anything? Thanks 😄 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-10-11.at.11.34.59.movAndroid: mWeb ChromeScreen.Recording.2024-10-11.at.11.03.31.moviOS: NativeScreen.Recording.2024-10-11.at.11.35.35.moviOS: mWeb SafariScreen.Recording.2024-10-11.at.10.59.19.movMacOS: Chrome / SafariScreen.Recording.2024-10-11.at.10.50.31.movMacOS: DesktopScreen.Recording.2024-10-14.at.17.04.28.mov |
@pac-guerreiro On the first time, I go to the transaction thread and go to Debug mode, the RBR display true but visible LHN reason display "is temporarily focused". But if we go back and open again, the reason display correctly (has IOU Violations). Screen.Recording.2024-10-11.at.11.03.31.mov |
@DylanDylann I'm currently investigating this and I think I'm observing the same behaviour in this PR - #49962 It seems that the data that we read for displaying the I'm digging through the code to understand what data is triggering the RBR and why it differs from the data for |
@pac-guerreiro Will we handle this bug here? |
@pac-guerreiro I think we can utilize hasRBR in DebugReportPage index 261d2db208..66779ef999 100644
--- a/src/libs/DebugUtils.ts
+++ b/src/libs/DebugUtils.ts
@@ -601,7 +601,7 @@ function validateReportActionJSON(json: string) {
/**
* Gets the reason for showing LHN row
*/
-function getReasonForShowingRowInLHN(report: OnyxEntry<Report>): TranslationPaths | null {
+function getReasonForShowingRowInLHN(report: OnyxEntry<Report>, hasRBR: boolean): TranslationPaths | null {
if (!report) {
return null;
}
@@ -620,10 +620,7 @@ function getReasonForShowingRowInLHN(report: OnyxEntry<Report>): TranslationPath
includeSelfDM: true,
});
- if (
- !([CONST.REPORT_IN_LHN_REASONS.HAS_ADD_WORKSPACE_ROOM_ERRORS, CONST.REPORT_IN_LHN_REASONS.HAS_IOU_VIOLATIONS] as Array<typeof reason>).includes(reason) &&
- SidebarUtils.shouldShowRedBrickRoad(report, reportActionsCollection?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report?.reportID}`], doesReportHaveViolations, transactionViolations)
- ) {
+ if (!([CONST.REPORT_IN_LHN_REASONS.HAS_ADD_WORKSPACE_ROOM_ERRORS, CONST.REPORT_IN_LHN_REASONS.HAS_IOU_VIOLATIONS] as Array<typeof reason>).includes(reason) && hasRBR) {
return `debug.reasonVisibleInLHN.hasRBR`;
}
diff --git a/src/pages/Debug/Report/DebugReportPage.tsx b/src/pages/Debug/Report/DebugReportPage.tsx
index 530b4b5f4a..5dd91874bc 100644
--- a/src/pages/Debug/Report/DebugReportPage.tsx
+++ b/src/pages/Debug/Report/DebugReportPage.tsx
@@ -58,13 +58,12 @@ function DebugReportPage({
if (!report) {
return [];
}
-
- const reasonLHN = DebugUtils.getReasonForShowingRowInLHN(report);
- const {reason: reasonGBR, reportAction: reportActionGBR} = DebugUtils.getReasonAndReportActionForGBRInLHNRow(report) ?? {};
- const reportActionRBR = DebugUtils.getRBRReportAction(report, reportActions);
const shouldDisplayViolations = ReportUtils.shouldDisplayTransactionThreadViolations(report, transactionViolations, parentReportAction);
const shouldDisplayReportViolations = ReportUtils.isReportOwner(report) && ReportUtils.hasReportViolations(reportID);
const hasRBR = SidebarUtils.shouldShowRedBrickRoad(report, reportActions, !!shouldDisplayViolations || shouldDisplayReportViolations, transactionViolations);
+ const reasonLHN = DebugUtils.getReasonForShowingRowInLHN(report, hasRBR);
+ const {reason: reasonGBR, reportAction: reportActionGBR} = DebugUtils.getReasonAndReportActionForGBRInLHNRow(report) ?? {};
+ const reportActionRBR = DebugUtils.getRBRReportAction(report, reportActions);
const hasGBR = !hasRBR && !!reasonGBR;
|
Waiting for your final review 😄 |
Waiting on final review from @mountiny |
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.
Sorry for late review, can you please sync main?
…-visible-in-lhn-debug-section # Conflicts: # src/libs/ReportUtils.ts
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! loooks good to me but can you please double check the implementation is same no as you moving across the files
On it! I'll let you know when I'm done 😄 |
I double checked the implementations that I migrated between files are correct! |
✋ 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/mountiny in version: 9.0.50-0 🚀
|
@pac-guerreiro if its just this issue and nothing else, then yes |
No problem, thanks. Can you link the issue to it as well |
Marked this as NoQa since it wont be passing, please add the testing steps to the other PR too |
Sure, here is the link to the issue - #50665 |
🚀 Deployed to production by https://github.com/marcaaron in version: 9.0.50-8 🚀
|
const parentReportAction: OnyxEntry<ReportAction> = | ||
!report?.parentReportID || !report?.parentReportActionID ? undefined : allReportActions?.[report.parentReportID ?? '-1']?.[report.parentReportActionID ?? '-1']; | ||
|
||
if (ReportActionsUtils.wasActionTakenByCurrentUser(parentReportAction) && ReportActionsUtils.isTransactionThread(parentReportAction)) { |
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.
We shouldn't had shown a RBR for archieved workspaces, this caused #50573
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.
@allgandalf I just moved this function from OptionsListUtils
to ReportUtils
in this PR.
If there was a problem, it already existed before this PR.
Details
Fixed Issues
$#50403
PROPOSAL:
Has RBR
.Tests
Debug mode
introubleshoot
home
page, open a chat report from LHN that has aRBR
Debug
Details
tab,Has RBR
is shown inVisible in LHN
for report that hasRBR
in LHNOffline tests
Same as tests
QA Steps
Same as tests
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop