-
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
Reports with "report not found" error cause Inbox tab RBR #51675
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DylanDylann You're totally right! I just looked at that line and thought I could simplify it 😅
I'll just revert this change, thanks
@@ -131,7 +137,7 @@ function DebugTabView({selectedTab = '', chatTabBrickRoad, activeWorkspaceID}: D | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use chatTabBrickRoad directly instead of getChatTabBrickRoadReport function?
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.
chatTabBrickRoad
doesn't include the report that I need to redirect the user
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.
@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 |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 🚀
|
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 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
Android.-.Chrome.mp4
iOS: Native
iOS: mWeb Safari
iOS.-.Safari.mp4
MacOS: Chrome / Safari
MacOS.-.Chrome.mp4
MacOS: Desktop