-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[$500] Send money - Pay elsewhere appears for second on send money #29311
Comments
Triggered auto assignment to @zanyrenney ( |
Job added to Upwork: https://www.upwork.com/jobs/~012a35d1f8510e892f |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Send money - Pay elsewhere appears for second on send money What is the root cause of that problem?we have condition to show What changes do you think we should make in order to solve the problem?At ReportPreview component we can subscribe loading status export default compose(
withLocalize,
withOnyx({
...
+ reportMetadata: {
+ key: ({chatReportID}) => `${ONYXKEYS.COLLECTION.REPORT_METADATA}${chatReportID}`,
+ initialValue: {
+ isLoadingReportActions: true,
+ isLoadingMoreReportActions: false,
+ },
+ },
}),
)(ReportPreview); and set props type for reportMetadata {!props.reportMetadata.isLoadingReportActions && shouldShowSettlementButton && (
<SettlementButton What alternative solutions did you explore? (Optional)Instead of checking the condition to render we can apply the loading state {props.reportMetadata.isLoadingReportActions ? (
<ActivityIndicator
color={themeColors.spinner}
size="large"
style={StyleSheet.absoluteFill}
/>
) : (
shouldShowSettlementButton && (
<SettlementButton
currency={props.iouReport.currency}
policyID={props.policyID}
chatReportID={props.chatReportID}
iouReport={props.iouReport}
onPress={(paymentType) => IOU.payMoneyRequest(paymentType, props.chatReport, props.iouReport)}
enablePaymentsRoute={ROUTES.ENABLE_PAYMENTS}
addBankAccountRoute={bankAccountRoute}
style={[styles.requestPreviewBox]}
anchorAlignment={{
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT,
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM,
}}
/>
)
)} 29311.mp4if we have any loading pattern in this case we can apply it |
ProposalPlease re-state the problem that we are trying to solve in this issue.Send money - Pay elsewhere appears for second on send money What is the root cause of that problem?When sending money optimistic data should show that this payment is already completed, but it is not doing that. That is why initially I think send money logic was different before, paying to send money request was separate action than creating send money itself. That is why we have this problem. What changes do you think we should make in order to solve the problem?We should update optimistic data here to include Lines 2119 to 2122 in 8c73c2b
statusNum corresponds to payment status and is checked here to show Settlement buttonApp/src/components/ReportActionItem/ReportPreview.js Lines 173 to 175 in e1368c0
What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Send money - Pay elsewhere appears for second on send money What is the root cause of that problem?When we are using IOU.sendMoneyElsewhere, we are getting optimisticData from getSendMoneyParams which returns optemisticData that doesn't include statusNum in it, so when we are checking isSettled inside ReportUtils.isSettled we are expecting report.statusNum to be initially ready and have REPORT.STATUS.REIMBURSED as it's value to decide that it indeed is settled but it will not be as we are not writing it in sendMoneyElsewhere Lines 277 to 286 in f557852
What changes do you think we should make in order to solve the problem?Since sendMoneyElsewhere will always mean that the user is sending money elsewhere it will be always settles so we can include that in the optemisticData to make sure it's readily available, we can do that by passing statusNum to getSendMoneyParams and adding it there to the optimisticIOUReportData function sendMoneyElsewhere(report, amount, currency, comment, managerID, recipient) {
const statusNum = CONST.REPORT.STATUS.REIMBURSED;
const {params, optimisticData, successData, failureData} = getSendMoneyParams(report, amount, currency, comment, CONST.IOU.PAYMENT_TYPE.ELSEWHERE, managerID, recipient, statusNum); const optimisticIOUReportData = {
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.REPORT}${optimisticIOUReport.reportID}`,
value: {
...optimisticIOUReport,
lastMessageText: optimisticIOUReportAction.message[0].text,
lastMessageHtml: optimisticIOUReportAction.message[0].html,
statusNum: statusNum,
},
}; ResultScreen.Recording.2023-10-11.at.8.13.26.PM.mov |
@suneox @alitoshmatov @AmjedNazzal Thanks for proposals, everyone. I appreciate it. But it seems this issue has been fixed in #29358. I couldn't reproduce this bug in the latest main. |
I also can't reproduce, so based off that and the linked issue above, closing! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number:
Reproducible in staging?:
Reproducible in production?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:
Action Performed:
Expected Result:
It should not show Pay elsewhere button
Actual Result:
Pay elsewhere appears for second
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Android: Native
https://github.com/Expensify/App/assets/93399543/f9906108-1a3a-4f5d-943d-96957585e28
Android: mWeb Chrome
Screen_Recording_20231011_123219_Chrome.mp4
iOS: Native
Simulator.Screen.Recording.-.iPhone.13.-.2023-10-11.at.14.01.33.mp4
iOS: mWeb Safari
RPReplay_Final1697008039.MP4
MacOS: Chrome / Safari
Screen.Recording.2023-10-11.at.11.56.55.AM.mov
Recording.4944.mp4
MacOS: Desktop
Screen.Recording.2023-10-11.at.12.50.09.PM.mov
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: