Repository navigation
Refactor pay with wallet API - #12646
Conversation
mountiny
left a comment
There was a problem hiding this comment.
Left couple of comments, great job so far!
| optimisticData: [ | ||
| { | ||
| onyxMethod: CONST.ONYX.METHOD.MERGE, | ||
| key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.chatReportID}`, | ||
| value: { | ||
| [optimisticIouReportAction.reportActionID]: { | ||
| optimisticIouReportAction, | ||
| // Set pendingAction state for pattern B |
There was a problem hiding this comment.
I would move the optimisticData, failureData before this, define it like it is defined here
Lines 580 to 626 in 2356010
It makes it cleaner I think
There was a problem hiding this comment.
I'm happy with that, I don't really have feeling either way.
I don't think we have success data here though? do we?
There was a problem hiding this comment.
@sketchydroide I think we will want to add the successData same as here
Lines 122 to 132 in 652a51a
| {login: ownerEmail}, | ||
| {login: userEmail}, | ||
| ]; | ||
| const optimisticIouReportAction = ReportUtils.buildOptimisticIOUReportAction( |
There was a problem hiding this comment.
| const optimisticIouReportAction = ReportUtils.buildOptimisticIOUReportAction( | |
| const optimisticIOUReportAction = ReportUtils.buildOptimisticIOUReportAction( |
| ); | ||
|
|
||
| const newSequenceNumber = Report.getMaxSequenceNumber(chatReport.reportID) + 1; | ||
| const optimisticIouReportAction = ReportUtils.buildOptimisticIOUReportAction( |
There was a problem hiding this comment.
| const optimisticIouReportAction = ReportUtils.buildOptimisticIOUReportAction( | |
| const optimisticIOUReportAction = ReportUtils.buildOptimisticIOUReportAction( |
|
@sketchydroide is this a failure of |
|
Chatted with Andre, that is not due to this refactor and already exists like that. We will fix it in a follow-up PR |
|
I'm also getting a 401 while trying to cancel IOU requests while online 2022-12-16_10-47-31.mp4 |
Reviewer Checklist
Screenshots/VideosWeb2022-12-16_09-58-47.mp42022-12-19_10-42-49.mp42022-12-19_10-50-56.mp4Mobile Web - Chrome2022-12-16_12-54-39.mp42022-12-16_12-55-39.mp42022-12-19_11-37-07.mp42022-12-19_11-38-18.mp4Mobile Web - Safari2022-12-16_12-18-03.mp42022-12-19_11-43-12.mp4iOS2022-12-16_11-53-40.mp42022-12-19_11-41-49.mp4 |
|
This one #12646 (comment) happens on main as well for sure with other optimistic actions |
I was able to cancel IOU with no issue, weird, let me check the error you pasted. |
|
the error @stitesExpensify is having is here |
mountiny
left a comment
There was a problem hiding this comment.
Thank you for sticking through this as it was not easy for sure. I am approving and I think the testing @stitesExpensify done should be sufficient to move forwards, thanks for doing that too
|
Triggered auto assignment to @marcaaron ( |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
|
|
🚀 Deployed to staging by @stitesExpensify in version: 1.2.42-0 🚀
|
|
Unfortunately whenever I do the following test steps while offline:
|
|
Any console errors or anything? |
|
I've seen errors in PHP before cause CORS errors for me in the VM. It might be worth checking the logs. |
|
Hmmm... this isn't the VM though this is Staging 🤔 |
|
🚀 Deployed to production by @yuwenmemon in version: 1.2.42-2 🚀
|










CC @mountiny @youssef-lr
Details
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/213711
Tests
This will need to be tested with this Web PR
To test this you will need a user with a Gold Wallet - This SO explains how to create/update one on dev
You also need to make sure the money payments are all done in USD, other wise the correct button will not appear.
Remember you can always tap the currency symbol to change it.
In QA you need to be in both the betas
1. SendMoney With Wallet
Tip: Trigger offline state in App using Preferences -> Force offline.
Offline
+, selectSend MoneyPay with Expensifyoption in the settlement button dropdown, if you have more options (otherwise you can only see this option)Sent $X for <comment>+in the chat report.Send MoneySent $X for <comment>comment left and IOU preview with the correct amount+again and chooseSend MoneyPay with ExpensifyOnline
+again,Send Moneyand choose either User A or User CPay with Expensifyoption.Error
+button and selectSend MoneyPay with Expensify2. PayMoneyRequest
Offline
Pre-requisites:
PaybuttonPaybuttonPay with Expensifyoption in the dropdown and click the settlement buttonSettled up!message displays immediatelyYou paid <name of the receiver>and the preview is greyed outXto close the modal and navigate away to a different chat and back againOnline
Payin the IOU Details page, choosePay with Expensifyoption in the dropdown and click the settlement buttonYou paid <name of the receiver>and is not greyed out.Error
Payin the IOU PreviewCancelon the $10 requestPay with Expensifybutton in the IOU details modal to pay itXto dismiss the error messageQA Steps
Follow the same steps than in tests
Verify that no errors appear in the JS console
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)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)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.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.PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarhave been tested & I retested again)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)Screenshots
Web
Web-sendMoney.mp4
Web-Error-SendMoney.mp4
Web-Pay.mp4
Web-Pay-Error.mp4
Mobile Web - Chrome
Android-Web-SendMoney.mp4
Androide-Web-SendMoney-Error.mp4
Android-Web-Pay.mp4
Android-Web-Pay-Error.mp4
Mobile Web - Safari
iOs-Safari-sendMoney.mp4
iOs-Safari-sendMoney-error.mp4
iOs-Safari-Pay.mp4
iOs-Safari-Pay-error.mp4
Desktop
Desktop-SendMoney-offline.mp4
Desktop-sendmoney-online.mp4
desktop-sendmoney-error.mp4
desktop-pay.mp4
desktop-error.mp4
iOS
iPhone-sendMoney.mp4
iphone-sendMoney-error.mp4
iphone-pay.mp4
iphone-pay-error.mp4
Android
Android-SendMoney.mp4
Android-SendMoney-Error.mp4
Android-Pay.mp4
Android-Pay-Error.mp4