-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: expense can be moved to report of deleted workspace #62583
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
Conversation
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.
Can we add a unit test for this please?
@luacmartins Added a unit test. |
Reviewing now... |
src/libs/ReportUtils.ts
Outdated
@@ -9628,14 +9628,16 @@ function isReportOutstanding(iouReport: OnyxInputOrEntry<Report>, policyID: stri | |||
if (!iouReport || isEmptyObject(iouReport)) { | |||
return false; | |||
} | |||
const reportNameValuePair = allReportNameValuePair?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${iouReport.reportID}`]; |
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.
Will this update the view in the scenario below?
- [employee] is viewing the outstanding report
- [admin] removes [employee] from the policy
It seems like we're calling isReportOutstanding
in the view, but the component is not actually subscribed to Onyx changes. Maybe it'd update because removing the user from the policy would technically come along other updates to policy/report which the component might be listening to so we'd trigger another call to isReportOutstanding
. Just wanna confirm though
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.
@luacmartins You're right, I tested and the list isn't updated if a report is archived. I updated to subscribe reportNameValuePair
and pass it to the 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.
Yea, I think using Onyx.connect in lib methods in general is a bad pattern because it can lead to bugs like this.
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp1_62583-android-hybrid-002.mp4Android: mWeb Chrome1_62583-mweb-chrome-002.mp4iOS: HybridApp1_62583-ios-hybrid-002.mp4iOS: mWeb Safari1_62583-mweb-safari-002.mp4MacOS: Chrome / Safari62583-web-chrome-002.mp4MacOS: Desktop1_62583-desktop-002.mp4 |
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.
@lakchote @luacmartins Changes LGTM and works well. All yours.
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.
LGTM
@lakchote all yours |
✋ 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/lakchote in version: 9.1.51-0 🚀
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.1.51-6 🚀
|
Explanation of Change
fix: expense can be moved to report of deleted workspace
Fixed Issues
$ #62552
PROPOSAL: #62552 (comment)
Tests
Offline tests
Same
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectioncanBeMissing
param foruseOnyx
toggleReport
and notonIconClick
)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
Screen.Recording.2025-05-21.at.15.40.46.mov
Android: mWeb Chrome
Screen.Recording.2025-05-22.at.19.59.22.mov
iOS: Native
Screen.Recording.2025-05-22.at.20.03.42.mov
iOS: mWeb Safari
Screen.Recording.2025-05-22.at.20.00.24.mov
MacOS: Chrome / Safari
Screen.Recording.2025-05-22.at.19.57.56.mov
MacOS: Desktop
Screen.Recording.2025-05-22.at.20.04.51.mov