fix: The order of selected workspace and selected report are inconsistent#65248
Conversation
|
@hoangzinh 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] |
|
@hoangzinh android and ios is crashing when I am opening an expense report. I haven't added evidence for android and ios native. I think there is a known issue here |
|
@etCoderDysto can you try with expense with category? |
Yes, it is crashing when I am adding category too. Is it working fine for you when you open an expense report? |
| * @param report2 Details of the second report to be compared. | ||
| * @param selectedReportID ID of the selected report which needs to be at the beginning. | ||
| */ | ||
| function sortOutstandingReportsBySelected(report1: OnyxEntry<Report>, report2: OnyxEntry<Report>, selectedReportID: string | undefined): number { |
There was a problem hiding this comment.
Can you add unit tests for this function?
There was a problem hiding this comment.
I have added a unit test.
|
I can view expenses normally Screen.Recording.2025-07-03.at.20.20.18.mov |
|
@etCoderDysto have you created expense successfully? |
I can create an expense but it crashes when opening the expense. I cleaned the project and rebuild it as a new. It didn't fix my issue. I think other contributors are also facing similar issue. But it works fine if I opened the expense from reports page. I will by pass the crash by opening the expense from reports page and upload evidence for native devices. |
|
It's weird. I tested creating expenses a lot in a day and didn't face your issues. Can you test on latest main app? It could be because of our changes in this PR |
Yes, I have tried it on main. And I am facing the same issue on main too. |
|
anw, let try to complete the checklist. |
@hoangzinh I have added evidence for iOS and I have resolved merge conflict. PR is ready for further review. |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2025-07-10.at.17.31.17.web.mov |
|
@etCoderDysto could you please resolve conflicts? |
@cristipaval I have resolved conflicts🙏. |
|
✋ 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/cristipaval in version: 9.1.81-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.1.81-7 🚀
|
| if (report2?.reportID === selectedReportID) { | ||
| return 1; | ||
| } | ||
| return report1?.reportName?.localeCompare(report2?.reportName?.toLowerCase() ?? '') ?? 0; |
There was a problem hiding this comment.
Coming from #72039, we should sort the reports by created date to be consistent with Reports page.





Explanation of Change
Fixed Issues
$ #64152
PROPOSAL: #64152 (comment)
Tests
Same as QA steps
Offline tests
Same as QA steps
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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))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
android.chrome.mp4
iOS: Native
Screen.Recording.2025-07-09.at.12.17.31.in.the.afternoon.mp4
iOS: mWeb Safari
ios.safari.mp4
MacOS: Chrome / Safari
web.98.mp4
MacOS: Desktop
desktop.mp4