Skip to content
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

Sync newly returned report objects from commands #3544

Merged
merged 18 commits into from
Jul 8, 2021

Conversation

jasperhuangg
Copy link
Contributor

@jasperhuangg jasperhuangg commented Jun 11, 2021

Details

We were re-fetching the chat and IOU report objects once the payIOU, payWithWallet, and rejectTransaction commands completed, which was completely unnecessary. Now, since we're returning the updated IOU and Chat report objects from https://github.com/Expensify/Web-Expensify/pull/31190, we can directly update Onyx with them.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/165863

Tests

Make sure you have https://github.com/Expensify/Web-Expensify/pull/31318 either pulled or deployed.

  1. Create accounts A and B (or use any two testing accounts with no IOU report history between one another)
  2. Use A to request money from B.
  3. In account B, use "I'll settle up elsewhere" to pay the IOU report.
  4. Verify that the IOU report is settled, and the UI is updated to reflect it:

Screen Shot 2021-06-15 at 6 13 22 PM

4. Use A to request money from B. 5. In account B, decline the request. 6. Verify that the transaction was rejected correctly, and that the UI is updated to reflect it:

Screen Shot 2021-06-15 at 6 15 17 PM

QA Steps

Same as the above tests

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

android.mp4
desktop.mp4
ios.mp4
web.mp4

@jasperhuangg jasperhuangg self-assigned this Jun 11, 2021
@jasperhuangg jasperhuangg changed the title Sync newly returned report objects from commands [HOLD Web-Expensify 31190] Sync newly returned report objects from commands Jun 11, 2021
@jasperhuangg jasperhuangg marked this pull request as ready for review June 15, 2021 11:00
@jasperhuangg jasperhuangg requested a review from a team as a code owner June 15, 2021 11:00
@MelvinBot MelvinBot requested review from sketchydroide and removed request for a team June 15, 2021 11:00
@jasperhuangg jasperhuangg removed the request for review from sketchydroide June 15, 2021 11:01
@Julesssss Julesssss requested review from a team and removed request for Julesssss June 16, 2021 11:22
@MelvinBot MelvinBot requested review from mountiny and removed request for a team June 16, 2021 11:22
@Julesssss
Copy link
Contributor

I'm happy to review this as an additional reviewer, but we should always assign Pullerbear :)

@mountiny
Copy link
Contributor

I was testing it with the Web-Expensify brach and I was getting this stacktrace error and the create report button was just spinning for very long time. Not sure what to do about it, seems like Jules pointed at some problem with returning information about the Report, which could be the reason why it keeps spinning.

@Julesssss
Copy link
Contributor

Not sure what to do about it, seems like Jules pointed at some problem with returning information about the Report, which could be the reason why it keeps spinning.

In my case, I didn't see the spinner. The request returned quickly, but it was missing the extra data 😕

@mountiny
Copy link
Contributor

To be fair, there is something wrong with my dev environment, it is a second day it does not work as it should. I will escalate this to #engineering-chat

mountiny
mountiny previously approved these changes Jun 18, 2021
Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

Tested the branch with the relevant Web-E branch and it works well. I will approve since my comments are NAB, but consider implementing them and re-requesting the review. Good job with both of those PRs Jasper!

src/libs/actions/IOU.js Outdated Show resolved Hide resolved
src/libs/actions/IOU.js Outdated Show resolved Hide resolved
src/libs/actions/Report.js Outdated Show resolved Hide resolved
src/libs/actions/Report.js Outdated Show resolved Hide resolved
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
jasperhuangg and others added 3 commits June 21, 2021 11:07
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
@jasperhuangg
Copy link
Contributor Author

Thanks for the suggestions @mountiny, requested another review!

mountiny
mountiny previously approved these changes Jun 21, 2021
Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

Great @jasperhuangg!

@Julesssss
Copy link
Contributor

This is unblocked now, testing.

src/libs/actions/IOU.js Outdated Show resolved Hide resolved
Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

It tests well, but I made a few suggestions.

@mountiny
Copy link
Contributor

Tested it too, works as expected 👏

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

NAB: In addition to Jules' comments, just a small grammar details to keep the comments consistent.

src/libs/actions/IOU.js Outdated Show resolved Hide resolved
src/libs/actions/IOU.js Outdated Show resolved Hide resolved
src/libs/actions/IOU.js Outdated Show resolved Hide resolved
@jasperhuangg jasperhuangg changed the title [HOLD Web-Expensify 31318] Sync newly returned report objects from commands Sync newly returned report objects from commands Jul 1, 2021
Comment on lines 225 to 221

// Once we have successfully paid the IOU we will transfer the user to their platform of choice if they have
// selected something other than a manual settlement or Expensify Wallet e.g. Venmo or PayPal.me
if (paymentMethodType === CONST.IOU.PAYMENT_TYPE.PAYPAL_ME) {
Linking.openURL(buildPayPalPaymentUrl(amount, submitterPayPalMeAddress, currency));
} else if (paymentMethodType === CONST.IOU.PAYMENT_TYPE.VENMO) {
Linking.openURL(buildVenmoPaymentURL(amount, submitterPhoneNumber));
}
Copy link
Contributor

@Julesssss Julesssss Jul 1, 2021

Choose a reason for hiding this comment

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

Was this supposed to be removed? Am I missing something, or was this a mistake? Wouldn't this break Venmo/Paypal?

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

Changes look good, but I have one outstanding comment

@jasperhuangg jasperhuangg changed the title Sync newly returned report objects from commands [HOLD Web-Expensify 31318] Sync newly returned report objects from commands Jul 1, 2021
Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

My comment was referring to a commit that isn't included. Good to merge once Web-Expensify/pull/31318 is deployed to prod 👍

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

Great! Let's wait for the deploy before merging.

@jasperhuangg
Copy link
Contributor Author

Looks like https://github.com/Expensify/Web-Expensify/pull/31318 has been deployed, so I'm gonna merge this!

@jasperhuangg jasperhuangg merged commit c29ba9e into main Jul 8, 2021
@jasperhuangg jasperhuangg deleted the jasper-minimizeAPICalls branch July 8, 2021 01:53
@jasperhuangg jasperhuangg changed the title [HOLD Web-Expensify 31318] Sync newly returned report objects from commands Sync newly returned report objects from commands Jul 8, 2021
@roryabraham
Copy link
Contributor

Unfortunately the deploy comments are not working right now. This was deployed to staging yesterday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants