-
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
Fix: Infinite loading in policy expense chat when changing from auditor to employee #35923
Conversation
@aimane-chnaif 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] |
src/pages/home/ReportScreen.js
Outdated
@@ -643,7 +643,7 @@ export default compose( | |||
key: ({report}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report ? report.parentReportID : 0}`, | |||
selector: (parentReportActions, props) => { | |||
const parentReportActionID = lodashGet(props, 'report.parentReportActionID'); | |||
if (!parentReportActionID) { | |||
if (!parentReportActionID || !parentReportActions) { |
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.
Please pull main. This change seems redundant thanks to https://github.com/Expensify/App/pull/34106/files#diff-dd4bfa50713397aca8cb40145317936ab0affe19abc2a9c24d6c8849ed75dc9bR649
Reviewer Checklist
Screenshots/VideosAndroid: Nativeall.movAndroid: mWeb Chromeall.moviOS: Nativeall.moviOS: mWeb Safariall.movMacOS: Chrome / Safariall.movMacOS: Desktopall.mov |
src/pages/home/ReportScreen.js
Outdated
@@ -418,7 +418,7 @@ function ReportScreen({ | |||
!onyxReportID && | |||
prevReport.statusNum === CONST.REPORT.STATUS_NUM.OPEN && | |||
(report.statusNum === CONST.REPORT.STATUS_NUM.CLOSED || (!report.statusNum && !prevReport.parentReportID && prevReport.chatType === CONST.REPORT.CHAT_TYPE.POLICY_ROOM))) || | |||
((ReportUtils.isMoneyRequest(prevReport) || ReportUtils.isMoneyRequestReport(prevReport)) && _.isEmpty(report)) | |||
((ReportUtils.isMoneyRequest(prevReport) || ReportUtils.isMoneyRequestReport(prevReport) || ReportUtils.isPolicyExpenseChat(prevReport)) && _.isEmpty(report)) |
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.
This change itself doesn't fix the infinite loading issue. One more change is needed after #30168.
Screen.Recording.2024-02-11.at.6.27.02.PM.mov
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.
Updated!
@aimane-chnaif I just merged main and resolved all your feedbacks. |
src/pages/home/ReportScreen.js
Outdated
* @param {Object} report | ||
* @returns {Boolean} | ||
*/ | ||
function isDeletedReport(report) { |
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 still be true when report is real empty?
I suggest this return true when report is null
, undefined
, {}
as well.
And function name can just be isEmpty
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 still be true when report is real empty?
Yes it will still be true with null, undefined and {}.
And function name can just be isEmpty
Updated!
Waiting feedback from @aimane-chnaif. |
Code looks good. Please merge main |
I've merged |
While testing, I found weird bug.
Screen.Recording.2024-02-29.at.1.43.44.PM.mov@tienifr can you investigate why |
The Pusher reset the report by first |
This is also out of scope. User display name and avatar are broken in report preview action before opening expense report. Screen.Recording.2024-03-03.at.3.32.17.PM.mov |
@roryabraham Please have a look. |
@roryabraham Kindly check this when you have time. |
@aimane-chnaif |
Looks good |
@aimane-chnaif Please hold up, |
oh bad TS migration |
I asked confirmation in that PR - https://github.com/Expensify/App/pull/35566/files#r1521561705 |
@aimane-chnaif I got the reply from TS migration author and seems like that was a mandantory change. I updated Screen.Recording.2024-03-13.at.12.21.00-compressed.mov |
Looks good, though it's a bit weird |
Awating input from @roryabraham. |
@roryabraham looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
not sure what wasn't passing? Looked all 🟢 to me? |
🚀 Deployed to staging by https://github.com/roryabraham in version: 1.4.54-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.54-4 🚀
|
Details
This PR fixes the issue that app crashes when changing the role of user from auditor to employee.
Fixed Issues
$ #34879
PROPOSAL: #34879 (comment)
Tests
Pre-condition: User submitted an expense as an employee to a collect workspace and invited another user as an auditor.
Offline tests
NA
QA Steps
Pre-condition: User submitted an expense as an employee to a collect workspace and invited another user as an auditor.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.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 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.2024-02-08.at.15.13.35-compressed.mov
Android: mWeb Chrome
Screen.Recording.2024-02-08.at.15.13.35-compressed.mov
iOS: Native
Screen.Recording.2024-02-08.at.15.15.50-compressed.mov
iOS: mWeb Safari
Screen.Recording.2024-02-08.at.15.16.54-compressed.mov
MacOS: Chrome / Safari
Screen.Recording.2024-02-07.at.12.23.03-compressed.mov
Screen.Recording.2024-02-24.at.14.43.01-compressed.mov
MacOS: Desktop
Screen.Recording.2024-02-07.at.12.23.03-compressed.mov
Screen.Recording.2024-02-24.at.14.43.01-compressed.mov