[No QA] Implement max recent report prop in useSearchSelector.base.ts#71557
[No QA] Implement max recent report prop in useSearchSelector.base.ts#71557mountiny merged 5 commits intoExpensify:mainfrom
Conversation
Reviewer Checklist
Screenshots/Videos
|
|
@sosek108 can we add a test case for it? |
|
@getusha Yes, I've added test cases for new prop of |
| }; | ||
|
|
||
| filteredReports = optionsOrderBy(options.reports, recentReportComparator, maxElements, filteringFunction); | ||
| filteredReports = optionsOrderBy(options.reports, recentReportComparator, maxRecentReportElements ?? maxElements, filteringFunction); |
There was a problem hiding this comment.
Crashes when maxRecentReportElements is greater than the list size. How can we prevent that?
There was a problem hiding this comment.
what exactly is the error?
There was a problem hiding this comment.
Error: Heap is empty, cannot peek value
at eval (index.ts:955:1)
at Array.forEach (<anonymous>)
at optionsOrderBy (index.ts:948:1)
at getValidOptions (index.ts:1570:1)
at eval (useSearchSelector.base.ts:65:31)
at useSearchSelectorBase (useSearchSelector.base.ts:57:30)
at useSearchSelector (useSearchSelector.ts:11:31)
The above error occurred in the <InviteReportParticipantsPage> component.
React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.
Error Component Stack
at InviteReportParticipantsPage (InviteReportParticipantsPage.tsx:27:1)
at WithReportOrNotFound (withReportOrNotFound.tsx:17:30)
at WithNavigationTransitionEnd (withNavigationTransitionEnd.tsx:8:17)
at PlatformNavigator (index.tsx:18:17)
at div (<anonymous>)
at ModalStack (index.tsx:39:17)
at PlatformNavigator (index.tsx:18:17)
at div (<anonymous>)
at NoDropZone (index.tsx:8:1)
at NarrowPaneContextProvider (NarrowPaneContext.tsx:10:15)
at RightModalNavigator (RightModalNavigator.tsx:25:15)
at PlatformNavigator (index.tsx:18:17)
at WideRHPContextProvider (index.tsx:37:15)
at SupportalPermissionDeniedModalProvider (SupportalPermissionD…alProvider.tsx:9:15)
at DelegateNoAccessModalProvider (DelegateNoAccessModalProvider.tsx:18:15)
at LockedAccountModalProvider (LockedAccountModalProvider.tsx:12:15)
at SearchContextProvider (SearchContext.tsx:35:1)
at SidebarOrderedReportsContextProvider (useSidebarOrderedReports.tsx:33:1)
at OptionsListContextProvider (OptionListContextProvider.tsx:20:1)
at ComposeProviders (ComposeProviders.tsx:3:1)
at AuthScreens (AuthScreens.tsx:159:15)
at Suspense (<anonymous>)
at AppNavigator (index.tsx:7:15)
at NavigationRoot (NavigationRoot.tsx:71:1)
at DeeplinkWrapper (index.website.tsx:43:15)
at Expensify (Expensify.tsx:73:15)
at div (<anonymous>)
at ColorSchemeWrapper (index.tsx:7:15)
There was a problem hiding this comment.
Thanks. I've added a check if the limit in orderOptionsBy is negative and handle this accordingly
|
@mountiny Kind bump |
|
✋ 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.2.27-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.2.27-6 🚀
|


Explanation of Change
Fixed Issues
$ #66615
PROPOSAL: #66615 (comment)
Tests
InviteReportParticipantsPage.tsxand pass parametermaxRecentReportsToShowtouseSearchSelectorOffline tests
N/A
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
No QA steps as this is update inside a component that will be used in future
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop