Reports with "report not found" error cause Inbox tab RBR#51675
Conversation
…not-found-error-cause-inbox-tab-rbr
|
@pac-guerreiro Type script failed |
src/libs/WorkspacesSettingsUtils.ts
Outdated
|
|
||
| // If policyID is undefined, then all reports are checked whether they contain any brick road | ||
| const policyReports = policyID ? Object.values(allReports).filter((report) => report?.policyID === policyID) : Object.values(allReports); | ||
| const policyReports = Object.values(allReports).filter((report) => !policyID || report?.policyID === policyID); |
There was a problem hiding this comment.
@pac-guerreiro Why do you change this? I think the previous way would have been better. It avoids the loop if policyID is undefined and saves more condition checks. Wdyt?
There was a problem hiding this comment.
@DylanDylann You're totally right! I just looked at that line and thought I could simplify it 😅
I'll just revert this change, thanks
| const navigateTo = useCallback(() => { | ||
| if (selectedTab === SCREENS.HOME && !!chatTabBrickRoad) { | ||
| const report = getChatTabBrickRoadReport(activeWorkspaceID); | ||
| const report = getChatTabBrickRoadReport(activeWorkspaceID, currentReportID, reports, betas, policies, priorityMode, transactionViolations); |
There was a problem hiding this comment.
Could we use chatTabBrickRoad directly instead of getChatTabBrickRoadReport function?
There was a problem hiding this comment.
chatTabBrickRoad doesn't include the report that I need to redirect the user
There was a problem hiding this comment.
@DylanDylann nope, it returns a BrickRoad
|
@fedirjh Please ignore this PR, I will take over it. Thanks |
|
@pac-guerreiro The rest looks fine |
…not-found-error-cause-inbox-tab-rbr
|
@DylanDylann all feedback was addressed 😄 |
…not-found-error-cause-inbox-tab-rbr
|
@DylanDylann I just addressed the eslint issue 😄 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-10-31.at.23.45.47.movAndroid: mWeb ChromeScreen.Recording.2024-10-31.at.23.42.33.moviOS: NativeScreen.Recording.2024-10-31.at.23.46.56.moviOS: mWeb SafariScreen.Recording.2024-10-31.at.23.47.35.movMacOS: Chrome / SafariScreen.Recording.2024-10-31.at.23.39.59.movMacOS: DesktopScreen.Recording.2024-10-31.at.23.41.26.mov |
|
Waiting for the final review from @puneetlath |
puneetlath
left a comment
There was a problem hiding this comment.
For my understanding, what's the difference between src/libs/Navigation/AppNavigator/createCustomPlatformStackBottomTabNavigator/BottomTabBar.tsx and src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar.tsx? It feels like there's a lot of duplicated code between the two.
| }, [activeWorkspaceID, transactionViolations, reports, reportActions]); | ||
| setChatTabBrickRoad(getChatTabBrickRoad(activeWorkspaceID, currentReportID, reports, betas, policies, priorityMode, transactionViolations)); | ||
| // We need to get a new brick road state when report actions are updated, otherwise we'll be showing an outdated brick road. | ||
| // That's why reportActions is added as a dependency here |
There was a problem hiding this comment.
Hmm, why is this comment just about reportActions. All of these are needed since any of them can affect the RBR, right?
There was a problem hiding this comment.
@puneetlath I left the comment specific for reportActions because they are not being used inside the effect explicitly. So to prevent someone from removing the prop from the dependencies list I added that comment 😄
There was a problem hiding this comment.
Ah ok I see. That makes sense.
src/libs/Navigation/AppNavigator/createCustomPlatformStackBottomTabNavigator/BottomTabBar.tsx
Show resolved
Hide resolved
I feel the same as you, I would have two components, one with the common UI and logic and the other one with platform specific logic. But honestly I don't know what's the purpose of having the two components. |
Maybe it's worth bringing to the #open-source room. We don't have to refactor it in this PR, but if there's an opportunity to get rid of duplicated logic, that would be great. |
|
✋ 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/puneetlath in version: 9.0.59-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.0.59-3 🚀
|
| transactionViolations: OnyxCollection<TransactionViolation[]>, | ||
| policyMemberAccountIDs: number[] = [], | ||
| ): OnyxEntry<Report> { | ||
| const reportIDs = SidebarUtils.getOrderedReportIDs(currentReportId, reports, betas, policies, priorityMode, transactionViolations, policyID, policyMemberAccountIDs); |
There was a problem hiding this comment.
Using SidebarUtils.getOrderedReportIDs when calculating GBR/RBR state caused a performance issue: #55173
Proposal: #54802 (comment)
PR: #55260

Details
Fixed Issues
$#51488
PROPOSAL: #51488 (comment)
Tests
On web:
e.g. /r/12345)Offline tests
Same as tests.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
Android.-.Chrome.mp4
iOS: Native
iOS: mWeb Safari
iOS.-.Safari.mp4
MacOS: Chrome / Safari
MacOS.-.Chrome.mp4
MacOS: Desktop