Adjust #63648 PR code to new pure Onyx functions rule#63731
Conversation
5c08c43 to
230e138
Compare
230e138 to
240df21
Compare
358f664 to
9509710
Compare
|
Note: ESLint check is failing but can be safely ignored as this PR is taking care of the beta flag. |
|
@aldo-expensify 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] |
There was a problem hiding this comment.
This looks good to me, my only concern is this comment: #63731 (comment)
Do we have to do something about these lint errors?
My guess is "no".
src/libs/OptionsListUtils.ts
Outdated
| const report = getReportOrDraftReport(reportID); | ||
| const chatReport = getReportOrDraftReport(report?.chatReportID); |
There was a problem hiding this comment.
@JakubKorytko I'm not sure if this matters, but I see you started using getReportOrDraftReport which falls back to the ONYXKEYS.COLLECTION.REPORT_DRAFT collection if it doesn't find the report in ONYXKEYS.COLLECTION.REPORT. In the past, the code was just using ONYXKEYS.COLLECTION.REPORT, is this change safe?
There was a problem hiding this comment.
Good point. I'm pretty sure it is, but just to be safe, I'll replace these calls with getReport or something similar tomorrow.
There was a problem hiding this comment.
Eventually we will need to replace those too but definitely not in scope of this pr
There was a problem hiding this comment.
Eventually we will need to replace those too but definitely not in scope of this pr
agree
|
Yeah no need to do anything about those |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-06-11.at.4.34.50.PM.movAndroid: mWeb ChromeScreen.Recording.2025-06-11.at.4.45.00.PM.moviOS: HybridAppScreen.Recording.2025-06-11.at.3.12.53.PM.moviOS: mWeb SafariScreen.Recording.2025-06-11.at.3.18.31.PM.movMacOS: Chrome / SafariScreen.Recording.2025-06-11.at.12.26.09.PM.movScreen.Recording.2025-06-11.at.4.46.37.PM.movMacOS: DesktopScreen.Recording.2025-06-11.at.12.34.10.PM.mov |
@JakubKorytko can you explain more with this statement, what's the problem exactly ? |
|
@mountiny lets cancel the adhoc workflow, there are some updates still being pushed by @JakubKorytko |
This comment has been minimized.
This comment has been minimized.
|
@aldo-expensify I've changed added
Can be safely ignored as #63533 is taking care of the beta flag.
No longer a thing, it was done that way to avoid using |
4ad3e9a to
28f8c81
Compare
|
🚧 @trjExpensify has triggered a test Expensify/App build. You can view the workflow run here. |
|
@JakubKorytko could you please get someone from SWM assigned to take over this and handle any blockers/ comments instead of you? thanks! |
About the comments, I will address them and get this merged, but asked SWM about someone to take care of potential blockers. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
Hey, that's me! I'll watch out for potential blockers (🤞 there won't be any) |
allgandalf
left a comment
There was a problem hiding this comment.
codewise this LGTM!, I still need to perform some tests to make sure everything is correct, will update the checklist tomorrow
|
@blazejkustra @JakubKorytko could you please merge main once you get a chance? |
|
Can do a little later. |
|
ESLint check failing - unrelated to this PR, not something I've added and I see that it will be fixed somewhere else.
|
allgandalf
left a comment
There was a problem hiding this comment.
Code LGTM and tests well on all platforms. Hopefully no bugs should pass 🙏 ,
Thanks for taking care of this despite being ill @JakubKorytko 🙇 , get better soon!
|
All yours @aldo-expensify |
|
@JakubKorytko can you fix conflicts please |
|
@allgandalf Yeah, done, had to change Pros: for the first time in this PR history - no checks failing 💅 |
|
Leaving unmerged in case @mountiny wants to take a final look |
mountiny
left a comment
There was a problem hiding this comment.
Ah sorry, I did not expect to wait for me, changes look good to me, thanks @JakubKorytko @blazejkustra
@allgandalf @blazejkustra lets be ready for some regressions that slipped through testing, @allgandalf could you please leave a comment listing out the tests you have done during your testing, at least some of them. Thanks!
|
✋ 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/aldo-expensify in version: 9.1.67-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.1.67-2 🚀
|
Explanation of Change
According to slack convo and #63648 @mountiny comments in order to unblock deploy blocker handling non-pure functions added in the PR should be corrected in this PR.
However, to make it work correctly we need to also make functions that call
getOneTransactionThreadReportIDpure as much as we can without changing the whole codebase in one PR.Following functions were changed to accept reports from Onyx as a parameters instead of ID's:
getReportPrimaryActiongetSecondaryReportActionsgetOneTransactionThreadReportIDisPayAtEndExpenseReportgetReasonAndReportActionThatHasRedBrickRoadshouldReportBeInOptionListgetSendMoneyFlowOneTransactionThreadIDisOneTransactionReporthasReportErrorsOtherThanFailedReceiptisOneTransactionReportgenerateReportAttributesgetReasonAndReportActionForRBRInLHNRowgetReasonForShowingRowInLHNisOneTransactionThreadis semi-pure as it is still gettingchatReportfromallReports.getWorkspacesUnreadStatuseswas removed as it was used nowhere.Following components now use
useOnyxforchatReportand pass it to changed functions to make it more reactive:MoneyRequestReportActionsListMoneyRequestReportViewDebugReportPageReportDetailsPageReportScreenBaseReportActionContextMenuContext why these changes were introduced: https://expensify.slack.com/archives/C05LX9D6E07/p1748457444774569
Fixed Issues
$ #63827
PROPOSAL: N/A
Tests
[Issue fixed in the original PR should still be fixed, steps copy-pasted]
Because this is non-UI change and nothing was added but it is a huge refractor that cannot really be split into smaller parts as
getOneTransactionThreadReportIDis called about 40 times in the code, it is extremely hard to create test steps that are specific enough. However, what should be tested is all places where one-transaction report view can be displayed (e.g. Report view, RHP) and places where it shouldn't (e.g. LHN).Offline tests
Same as tests.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Web.mov
MacOS: Desktop