Expense - Deleted workspace appears in Create report RHP when workspace is deleted offline#72927
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@allroundexperts 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] |
| .filter( | ||
| (policy) => | ||
| shouldShowPolicy(policy, !!isOffline, currentUserPersonalDetails?.login) && | ||
| shouldShowPolicy(policy, false, currentUserPersonalDetails?.login) && |
There was a problem hiding this comment.
❌ PERF-2 (docs)
The expensive shouldShowPolicy function call is executed before simple property checks like !policy?.isJoinRequestPending and policy?.isPolicyExpenseChatEnabled. This means shouldShowPolicy runs for every policy, even those that could be quickly eliminated by simple property checks.
Suggested fix:
.filter(
(policy) =>
!policy?.isJoinRequestPending &&
policy?.isPolicyExpenseChatEnabled &&
(!hasPerDiemTransactions || canSubmitPerDiemExpenseFromWorkspace(policy)) &&
shouldShowPolicy(policy, false, currentUserPersonalDetails?.login),
)This reordering ensures simple checks eliminate items early, reducing unnecessary expensive function calls.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeScreen.Recording.2025-11-19.at.4.37.12.AM.moviOS: HybridAppiOS: mWeb SafariScreen.Recording.2025-11-19.at.4.30.39.AM.movMacOS: Chrome / SafariScreen.Recording.2025-11-19.at.4.26.18.AM.movMacOS: DesktopScreen.Recording.2025-11-19.at.4.29.44.AM.mov |
|
This does not seem to work @mkzie2. Can you please check? Screen.Recording.2025-11-12.at.11.37.32.PM.mov |
|
@allroundexperts I can't repro Screen.Recording.2025-11-13.at.15.47.03.mov |
|
@mkzie2 Can you please merge main? |
JmillsExpensify
left a comment
There was a problem hiding this comment.
All good from a product perspective.
|
🚀 Deployed to staging by https://github.com/Valforte in version: 9.2.62-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.2.62-5 🚀
|
Explanation of Change
Fixed an issue where deleted workspace in offline still appears in Create report RHP.
Fixed Issues
$ #71934
PROPOSAL: #71934 (comment)
Tests
Offline tests
QA Steps
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
Screen.Recording.2025-11-01.at.15.04.42.mov
Android: mWeb Chrome
Screen.Recording.2025-11-01.at.15.05.34.mov
iOS: Native
Screen.Recording.2025-11-01.at.15.06.40.mov
iOS: mWeb Safari
Screen.Recording.2025-11-01.at.15.08.50.mov
MacOS: Chrome / Safari
Screen.Recording.2025-11-01.at.15.09.59.mov
MacOS: Desktop
Screen.Recording.2025-11-01.at.15.10.26.mov