Skip to content

Refactor pay with wallet API - #12646

Merged
stitesExpensify merged 79 commits into
mainfrom
afonseca_refactor_pay_with_wallet
Dec 19, 2022
Merged

stitesExpensify merged 79 commits into
mainfrom
afonseca_refactor_pay_with_wallet

Conversation

@sketchydroide

@sketchydroide sketchydroide commented Nov 10, 2022 •

Copy link
Copy Markdown
Contributor

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

  1. As User B, click on the global create menu +, select Send Money
  2. Go through the prompt and select an existing account you haven't chatted before, let's call it User A
  3. Make sure the Currency is in USD
  4. In the last payment page, add a comment describing what the payment is for
  5. Choose Pay with Expensify option in the settlement button dropdown, if you have more options (otherwise you can only see this option)
  6. Press the button to pay
  7. Make sure you have been navigated to this new chat which is greyed out since it was optimistically created
  8. Confirm there is IOU preview showing the correct amount you have sent with.
  9. The report message says Sent $X for <comment>
  10. Click on the payment details and the message and amount is also correct in the right hand side and greyed out.
  11. Now click on the + in the chat report.
  12. Select Send Money
  13. Follow the prompt and send more money to User A
  14. Confirm there has been another Sent $X for <comment> comment left and IOU preview with the correct amount
  15. Now, click the global create + again and choose Send Money
  16. This time choose account you have already chatted with before (User C)
  17. Follow the prompts to sent money and choose Pay with Expensify
  18. Confirm you have been navigated to the correct report and the payment details are showing there greyed out

Online

  1. Go back online
  2. Confirm that the IOUPreview and the message are same and no longer greyed out in the chats
  3. Click on the global create button + again, Send Money and choose either User A or User C
  4. Follow the prompt and sent them money using the Pay with Expensify option.
  5. Confirm you have been navigated to the correct report and the payment details showed up correct, this time not greyed out.

Error

  1. Login as User C and go offline
  2. In other incognito window, login as User D
  3. As User D, who is online, create chat with User C and send them a message
  4. As User C, who is offline, click on the global create + button and select Send Money
  5. Send money to User D and choose Pay with Expensify
  6. Send the money and verify the new chat gets created and greyed out.
  7. As User C, go back online
  8. Verify you see an error on the optimistically created chat that failed to create
  9. Dismiss the error and verify you are able to clear the stale report (i.e it disappears after dismissing the error)
  10. Verify you see the message from User D in a different report.

2. PayMoneyRequest

Offline

Pre-requisites:

  • Have a chat between User A and User B, such that User B owes money to User A
  • Have a chat between User B and User C, such that User B owes money User C
  • All of this IOU need to be in USD
  1. As User B, navigate to the chat with User A and you should see an IOU preview with Pay button
  2. Press the Pay button
  3. In the IOU Details page, choose Pay with Expensify option in the dropdown and click the settlement button
  4. Verify a greyed out Settled up! message displays immediately
  5. Verify the IOU Preview at the top of the modal says You paid <name of the receiver> and the preview is greyed out
  6. Click the X to close the modal and navigate away to a different chat and back again
  7. Verify the IOUPreview and settled message in the chat view are greyed out
  8. Click the IOUPreview to access the detailed view again
  9. Verify that the message on the report and the IOUPreview in the header are still both greyed out

Online

  1. Go back online
  2. Confirm that the IOUPreview and the message don't change and are no longer greyed out.
  3. Still as User B, navigate to the chat with User C
  4. Click Pay in the IOU Details page, choose Pay with Expensify option in the dropdown and click the settlement button
  5. Verify the "Settled up!" message has immediately appeared in the IOU details modal and doesn't appear greyed out
  6. Verify the IOU Preview reads You paid <name of the receiver> and is not greyed out.

Error

  1. Login as User A
  2. Request $10 from User B
  3. Login as User B in another incognito window
  4. Navigate to the chat report with User A
  5. Go offline
  6. Click Pay in the IOU Preview
  7. As User A, go to the chat with User B and click on the IOU request details
  8. Click Cancel on the $10 request
  9. As User B, still offline, click the Pay with Expensify button in the IOU details modal to pay it
  10. Verify the greyed out "Settled up!" message has shown up and the report shows as paid.
  11. Go back online
  12. Verify you see an error message in-line because the request was cancelled before the payment was made offline.
  13. Navigate back to the LHN
  14. Verify you see a single red dot on the chat row that contains the failed settlement
  15. Navigate into the chat
  16. Verify you see an in-line error message on the failed settlement
  17. Click/tap the X to dismiss the error message
  18. Verify the error message disappears
  • Verify that no errors appear in the JS console

QA Steps

  • Follow the same steps than in tests

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

PR Reviewer Checklist

The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

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

@sketchydroide sketchydroide self-assigned this Nov 10, 2022
@mountiny
mountiny self-requested a review November 10, 2022 17:22

@mountiny mountiny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left couple of comments, great job so far!

Comment thread src/components/OfflineWithFeedback.js Resolved
Comment thread src/libs/actions/IOU.js Outdated
Comment on lines +760 to +767
optimisticData: [
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.chatReportID}`,
value: {
[optimisticIouReportAction.reportActionID]: {
optimisticIouReportAction,
// Set pendingAction state for pattern B

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move the optimisticData, failureData before this, define it like it is defined here

App/src/libs/actions/IOU.js

Lines 580 to 626 in 2356010

const optimisticData = [
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReportID}`,
value: {
[optimisticReportAction.sequenceNumber]: {
...optimisticReportAction,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
},
},
},
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${chatReportID}`,
value: chatReport,
},
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_IOUS}${iouReportID}`,
value: updatedIOUReport,
},
];
const successData = [
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReportID}`,
value: {
[optimisticReportAction.sequenceNumber]: {
pendingAction: null,
},
},
},
];
const failureData = [
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReportID}`,
value: {
[optimisticReportAction.sequenceNumber]: {
pendingAction: null,
errors: {
[DateUtils.getMicroseconds()]: Localize.translateLocal('iou.error.genericCancelFailureMessage', {type}),
},
},
},
},
];

It makes it cleaner I think

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sketchydroide I think we will want to add the successData same as here

App/src/libs/actions/IOU.js

Lines 122 to 132 in 652a51a

const successData = [
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.reportID}`,
value: {
[optimisticReportAction.sequenceNumber]: {
pendingAction: null,
},
},
},
];
just to clean up the pendingActions

Comment thread src/libs/actions/IOU.js Outdated
{login: ownerEmail},
{login: userEmail},
];
const optimisticIouReportAction = ReportUtils.buildOptimisticIOUReportAction(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const optimisticIouReportAction = ReportUtils.buildOptimisticIOUReportAction(
const optimisticIOUReportAction = ReportUtils.buildOptimisticIOUReportAction(

Comment thread src/libs/actions/IOU.js Outdated
);

const newSequenceNumber = Report.getMaxSequenceNumber(chatReport.reportID) + 1;
const optimisticIouReportAction = ReportUtils.buildOptimisticIOUReportAction(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const optimisticIouReportAction = ReportUtils.buildOptimisticIOUReportAction(
const optimisticIOUReportAction = ReportUtils.buildOptimisticIOUReportAction(

Comment thread src/libs/actions/IOU.js Resolved
@stitesExpensify

Copy link
Copy Markdown
Contributor

@sketchydroide is this a failure of PayMoneyRequest step 5? The top of the modal doesn't appear to be greyed out

2022-12-16_10-29-24

2022-12-16_10-29-29

@stitesExpensify

Copy link
Copy Markdown
Contributor

Chatted with Andre, that is not due to this refactor and already exists like that. We will fix it in a follow-up PR

@stitesExpensify

Copy link
Copy Markdown
Contributor

I'm also getting a 401 while trying to cancel IOU requests while online

2022-12-16_10-47-31.mp4
Bedrock\Client - Request finished ~~ host: 'auth' command: 'CancelMoneyRequest' jsonCode: '401 Unable to add transactions to Chat report' duration: '1' net: '0.058' wait: '0.634' proc: '0.308' commitCount: '16437'
2022-12-16T17:46:04.221327+00:00 expensidev2004 php-fpm: 3D4I8x /api.php aosdifajs@aodifja.com !ecash1.2.38-0! ?api? [info] Auth - AuthRequest #8 ~~ command: 'CancelMoneyRequest' jsonCode: '401' size: '194' duration: '2ms' host: 'auth' transactionID: '781132683453252363'
2022-12-16T17:46:04.221357+00:00 expensidev2004 php-fpm: 3D4I8x /api.php aosdifajs@aodifja.com !ecash1.2.38-0! ?api? [info] Auth - Call CancelMoneyRequest return 401
2022-12-16T17:46:04.221904+00:00 expensidev2004 php-fpm: 3D4I8x /api.php aosdifajs@aodifja.com !ecash1.2.38-0! ?api? [hmmm] Throw ExpException - 59e9183938ef83fa3ea020c489708653 ~~ message: '401 Unable to add transactions to Chat report' exceptionMessage: 'Auth CancelMoneyRequest returned an error' exceptionFile: '/vagrant/Web-Expensify/lib/Auth.php' exceptionLine: '121' exceptionCode: '401'
2022-12-16T17:46:04.221920+00:00 expensidev2004 php-fpm: 3D4I8x /api.php aosdifajs@aodifja.com !ecash1.2.38-0! ?api? [info] [trace] StackTrace start
2022-12-16T17:46:04.221926+00:00 expensidev2004 php-fpm: 3D4I8x /api.php aosdifajs@aodifja.com !ecash1.2.38-0! ?api? [info] [trace] 0/2. file '/vagrant/Web-Expensify/lib/Auth.php' function '_standardResponseHandler' line '2624'
2022-12-16T17:46:04.221931+00:00 expensidev2004 php-fpm: 3D4I8x /api.php aosdifajs@aodifja.com !ecash1.2.38-0! ?api? [info] [trace] 1/2. file '/vagrant/Web-Expensify/lib/ReportAPI.php' function 'cancelMoneyRequest' line '1853'
2022-12-16T17:46:04.221935+00:00 expensidev2004 php-fpm: 3D4I8x /api.php aosdifajs@aodifja.com !ecash1.2.38-0! ?api? [info] [trace] 2/2. file '/vagrant/Web-Expensify/api.php' function 'cancelMoneyRequest' line '876'
2022-12-16T17:46:04.221942+00:00 expensidev2004 php-fpm: 3D4I8x /api.php aosdifajs@aodifja.com !ecash1.2.38-0! ?api? [info] [trace] StackTrace end
2022-12-16T17:46:04.222074+00:00 expensidev2004 php-fpm: 3D4I8x /api.php aosdifajs@aodifja.com !ecash1.2.38-0! ?api? [warn] [OOPS!] API Threw: Auth CancelMoneyRequest returned an error ExpException - 59e9183938ef83fa3ea020c489708653 ~~ message: '401 Unable to add transactions to Chat report' exceptionMessage: 'Auth CancelMoneyRequest returned an error' exceptionFile: '/vagrant/Web-Expensify/lib/Auth.php' exceptionLine: '121' exceptionCode: '401'

@stitesExpensify

Copy link
Copy Markdown
Contributor

2022-12-16_11-29-11

I've also been noticing this on desktop where the welcome message is below the request while offline. AFAIK that shouldn't ever happen because we are manually generating those actions and their sequence numbers

@stitesExpensify

stitesExpensify commented Dec 16, 2022 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
2022-12-16_09-58-47.mp4
2022-12-19_10-42-49.mp4
2022-12-19_10-50-56.mp4
Mobile Web - Chrome
2022-12-16_12-54-39.mp4
2022-12-16_12-55-39.mp4
2022-12-19_11-37-07.mp4
2022-12-19_11-38-18.mp4
Mobile Web - Safari
2022-12-16_12-18-03.mp4
2022-12-19_11-43-12.mp4
Desktop
2022-12-16_11-18-17.mp4
2022-12-16_11-29-35
2022-12-19_10-54-30.mp4
2022-12-19_11-06-08.mp4
iOS
2022-12-16_11-53-40.mp4
2022-12-19_11-41-49.mp4
Android
2022-12-16_12-46-55.mp4
2022-12-16_12-50-31
2022-12-19_11-16-19.mp4
2022-12-19_11-35-14.mp4

@mountiny

Copy link
Copy Markdown
Contributor

This one #12646 (comment) happens on main as well for sure with other optimistic actions

@sketchydroide

sketchydroide commented Dec 19, 2022 •

Copy link
Copy Markdown
Contributor Author

I'm also getting a 401 while trying to cancel IOU requests while online

I was able to cancel IOU with no issue, weird, let me check the error you pasted.

@sketchydroide

Copy link
Copy Markdown
Contributor Author

the error @stitesExpensify is having is here
and it seems that you have a chatReport with ID 0, which is a bit weird.

@mountiny mountiny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@luacmartins luacmartins mentioned this pull request Dec 19, 2022
52 of 53 tasks
@stitesExpensify stitesExpensify added the InternalQA This pull request required internal QA label Dec 19, 2022
@stitesExpensify
stitesExpensify merged commit 1b0daf5 into main Dec 19, 2022
@stitesExpensify
stitesExpensify deleted the afonseca_refactor_pay_with_wallet branch December 19, 2022 21:58
@melvin-bot

melvin-bot Bot commented Dec 19, 2022

Copy link
Copy Markdown

Triggered auto assignment to @marcaaron (InternalQA), see https://stackoverflow.com/c/expensify/questions/5042 for more details.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
TTI 812.227 ms → 837.764 ms (+25.537 ms, +3.1%)
runJsBundle 190.219 ms → 195.594 ms (+5.375 ms, +2.8%)
nativeLaunch 9.161 ms → 9.774 ms (+0.613 ms, +6.7%)
regularAppStart 0.016 ms → 0.016 ms (-0.001 ms, -4.2%)
Show details
Name Duration
TTI Baseline
Mean: 812.227 ms
Stdev: 30.314 ms (3.7%)
Runs: 750.9251390001737 771.7467430001125 775.2967779999599 783.9797539999709 784.215710000135 784.3369819996879 787.0761550003663 788.1829490000382 789.8033079998568 793.8793339999393 795.3339979997836 797.3325359998271 806.8578200000338 807.6831939998083 807.8110139998607 809.1465269997716 810.5829360000789 811.7145330002531 814.4854439999908 816.37447099993 817.6879839999601 818.9192160000093 823.351208999753 831.7130410000682 835.2589010000229 844.5513749998063 846.3724710000679 851.4694199999794 861.0772049999796 878.0465710000135 883.8370660003275

Current
Mean: 837.764 ms
Stdev: 35.192 ms (4.2%)
Runs: 767.8199789999053 773.3547179996967 780.8794889999554 798.2653000000864 802.1516720000654 810.7020380003378 812.7131510004401 818.2554129995406 822.4178259996697 825.9113309998065 826.2413149997592 829.9489420000464 832.2204750003293 835.1718119997531 835.297585000284 836.5298220003024 837.2923870002851 840.2307930001989 840.368981000036 840.8239029999822 844.9103690003976 847.3818629998714 848.707038000226 860.1795690003783 861.5170609997585 869.7654269998893 871.7857499998063 873.5982569996268 884.1777590001002 914.2694640001282 927.7975719999522
runJsBundle Baseline
Mean: 190.219 ms
Stdev: 19.339 ms (10.2%)
Runs: 166 167 167 170 170 171 172 173 174 178 178 180 182 183 184 184 186 186 188 189 193 194 198 202 205 206 214 216 225 226 228 232

Current
Mean: 195.594 ms
Stdev: 19.255 ms (9.8%)
Runs: 168 168 169 174 175 177 178 179 180 181 186 186 187 187 189 189 190 193 200 201 202 207 207 208 211 211 215 221 223 225 233 239
nativeLaunch Baseline
Mean: 9.161 ms
Stdev: 1.298 ms (14.2%)
Runs: 7 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 11 11 12 12 12

Current
Mean: 9.774 ms
Stdev: 1.210 ms (12.4%)
Runs: 8 8 8 8 8 8 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 13
regularAppStart Baseline
Mean: 0.016 ms
Stdev: 0.001 ms (9.1%)
Runs: 0.014200999867171049 0.014241999946534634 0.014812000095844269 0.014932999853044748 0.014932999853044748 0.014932999853044748 0.014973999932408333 0.01509599993005395 0.015217999927699566 0.015665000304579735 0.015665999613702297 0.015666000079363585 0.015705999918282032 0.015829000622034073 0.01587000023573637 0.015910000074654818 0.01599099999293685 0.015992000233381987 0.01607199991121888 0.016194999683648348 0.016195000149309635 0.016398000065237284 0.016642999835312366 0.017171999905258417 0.01741599990054965 0.017943999730050564 0.01818900043144822 0.018391999881714582 0.01847400004044175 0.019898000173270702 0.020060000009834766

Current
Mean: 0.016 ms
Stdev: 0.001 ms (9.5%)
Runs: 0.0134680001065135 0.013875999487936497 0.013957000337541103 0.014038000255823135 0.014077999629080296 0.014078999869525433 0.014078999869525433 0.014282000251114368 0.01428299956023693 0.014403999783098698 0.01444500032812357 0.01460800040513277 0.014852000400424004 0.014892000705003738 0.014974000863730907 0.015421999618411064 0.015625 0.015868999995291233 0.01587000023573637 0.01611399929970503 0.016114000231027603 0.01664199959486723 0.016642999835312366 0.0166830001398921 0.016927000135183334 0.017171000130474567 0.017496999353170395 0.017618000507354736 0.01769999973475933 0.018596000038087368 0.018757999874651432

@OSBotify OSBotify mentioned this pull request Dec 20, 2022
34 tasks done
@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by @stitesExpensify in version: 1.2.42-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@yuwenmemon

yuwenmemon commented Dec 20, 2022 •

Copy link
Copy Markdown
Contributor

Unfortunately whenever I do the following test steps while offline:

Offline
16. This time choose account you have already chatted with before (User C)
17. Follow the prompts to sent money and choose Pay with Expensify
19. Confirm you have been navigated to the correct report and the payment details are showing there greyed out
Online

  1. Go back online
  2. Confirm that the IOUPreview and the message are same and no longer greyed out in the chats

I get an unexpected error:
Screenshot 2022-12-20 at 10 31 57 AM

Shows up fine after a refresh:
Screenshot 2022-12-20 at 10 35 22 AM

@stitesExpensify

Copy link
Copy Markdown
Contributor

Any console errors or anything?

@luacmartins luacmartins mentioned this pull request Dec 20, 2022
52 of 53 tasks
@yuwenmemon

Copy link
Copy Markdown
Contributor

Sorry moved onto the next step (which worked great!):
Screenshot 2022-12-20 at 10 46 18 AM
Screenshot 2022-12-20 at 10 46 34 AM

@yuwenmemon

Copy link
Copy Markdown
Contributor

It's a CORS error weirdly?
Screenshot 2022-12-20 at 10 58 10 AM

@youssef-lr

Copy link
Copy Markdown
Contributor

I've seen errors in PHP before cause CORS errors for me in the VM. It might be worth checking the logs.

@yuwenmemon

Copy link
Copy Markdown
Contributor

Hmmm... this isn't the VM though this is Staging 🤔

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by @yuwenmemon in version: 1.2.42-2 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

InternalQA This pull request required internal QA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants