[CP Staging] Track when a split is created from global create to call proper API#32878
Conversation
| // If we have a receipt let's start the split bill by creating only the action, the transaction, and the group DM if needed | ||
| if (iouType === CONST.IOU.TYPE.SPLIT && receiptFile) { | ||
| const existingSplitChatReportID = CONST.REGEX.NUMBER.test(reportID) ? reportID : ''; | ||
| const existingSplitChatReportID = CONST.REGEX.NUMBER.test(report.reportID) ? reportID : ''; |
There was a problem hiding this comment.
This seems to be an existing bug. reportID is a reference to the reportID coming from the URL route, and that will always be a number. This changes the code so that it's testing if the report.reportID belongs to an optimistic report or not, which I think is what is intended.
|
@tgolen if this is urgent I can jump in for a review |
|
@tgolen You need to update the type object of the transaction to accommodate this change. |
Thanks for this, as the PR is blocking deploy and this only triggers a warning we can handle that separately. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Test case 2 failing with #32895 |
Reviewer Checklist
Screenshots/VideosTest 1Screen.Recording.2023-12-12.at.4.25.50.PM.movTest 3Screen.Recording.2023-12-12.at.4.29.15.PM.mov |
|
@Julesssss Please merge this |
|
@johnmlee101 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] |
Julesssss
left a comment
There was a problem hiding this comment.
Looking good. Thanks for treating this with urgency. Will merge and CP
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Track when a split is created from global create to call proper API (cherry picked from commit 4bcdcf5)
|
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 1.4.11-13 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.11-25 🚀
|
Details
The original intention of the
SplitBillandSplitBillAndOpenReportAPI commands was to call them depending on if the user started the request from an existing chat or from the global create menu (respectively).When I refactored things, the concept of "starting from global create" really morphed into a concept of "is this reportID in the URL from an optimistic report or a real report". I thought it would also work for the split case, but it doesn't look like it works very well.
In order to resolve the blocker with urgency, I have added a flag into the Onyx draft to indicate whether or not the request started from the global create menu or not. This results in the correct APIs being called with the correct reportID now.
Fixed Issues
$ #32853
Tests
First Test
Second Test
Third Test
Offline tests
Same as the above
QA Steps
Same as the above
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.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)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
Unable to test emulator because local development builds are broken
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop