Stop creating the transaction thread reports optimistically for RequestMoney#58825
Conversation
…optimistic-transaction-RequestMoney
…optimistic-transaction-RequestMoney # Conflicts: # src/libs/actions/IOU.ts
|
@hungvu193 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] |
|
I'll start reviewing in the morning |
|
If I create an expense from QAB, It will reset the receiver to the previous receiver right after I choose one. Screen.Recording.2025-03-27.at.17.10.12.mov |
@hungvu193 It looks like the expected behavior, that the active workspace is selected as receiver by default when you create the expense from FAB. |
|
Weird. I checked staging and it didn't reset to previous receiver. Let me check prod |
…optimistic-transaction-RequestMoney
|
@hungvu193 I've caught it as well! I've merged the main, and it seems to be fixed. Let me know if it fixes it for you as well |
Yep. It's fixed 😄 |
|
Current changes from main broke the tab UI ,which also prevents me from testing. I'll continue testing tomorrow |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-03-28.at.14.42.30.movAndroid: mWeb ChromeScreen.Recording.2025-03-28.at.14.36.44.moviOS: NativeiOS: mWeb SafariScreen.Recording.2025-03-28.at.14.32.35.movMacOS: Chrome / SafariScreen.Recording.2025-03-28.at.14.31.09.movMacOS: DesktopScreen.Recording.2025-03-28.at.14.29.09.mov |
hungvu193
left a comment
There was a problem hiding this comment.
Tests well! Please merge main @VickyStash
…optimistic-transaction-RequestMoney
|
@iwiznia kind bumb 🙂 |
| // Ensure we have a childReportID associated with the IOU report action | ||
| return singleAction?.childReportID; | ||
| // Since we don't always create transaction thread optimistically, we return CONST.FAKE_REPORT_ID | ||
| return singleAction?.childReportID ?? CONST.FAKE_REPORT_ID; |
There was a problem hiding this comment.
Why do we need the constant? Can't we use null or "" or leave undefined which IIRC is what we said when we did not have a string ID?
There was a problem hiding this comment.
In this specific case, we need to return a truly value, so null, '', or undefined won't work.
There was a problem hiding this comment.
Why does it need to be truthy?
There was a problem hiding this comment.
To explain that, let's take a look at a couple of lines above of the getOneTransactionThreadReportID function and what it does.
- It filters out iou actions related to the report.
- it checkes that we have only one assosiated iou action => which means we have one transaction thread
- this singe iou action is put into
singleActionconst
App/src/libs/ReportActionsUtils.ts
Line 1213 in 8dfbd12
We won't always have the childReportID inside singleAction now, cause we won't generate the transaction thread report right from the start.
But the app should still act with the report as with the one transaction thread report. Handle the navigation and UI in an appropriate way.
That's why in this case we return truly value.
@iwiznia what do you think?
|
✋ 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/iwiznia in version: 9.1.26-0 🚀
|
…evert-58825 [CP Staging] Revert "Merge pull request #58825"
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.26-10 🚀
|
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 9.1.27-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.1.28-15 🚀
|
Explanation of Change
Stop creating the transaction thread reports optimistically for RequestMoney.
Fixed Issues
$ #58828
PROPOSAL: N/A
Tests
2.1 In the chat tap FAB -> Create expense. Go through the steps and create a manual expense. It will be the first expense in this 1-1 chat.
2.2 Check that the
RequestMoneyAPI call didn't create a transaction thread report.2.3 Tap on the expense -> the transaction thread report should be created and opened.
Offline tests
Same, as in the Tests section.
QA Steps
Same, as in the Tests section.
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.mp4
Android: mWeb Chrome
android_web.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios_web.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4