Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.36k stars 2.78k forks source link

App crashes and throws unexpected error while splitting bill after closing and reopening account with same email #20303

Closed kavimuru closed 1 year ago

kavimuru commented 1 year ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Log in to Account A and navigate to the plus sign at the bottom to request money from Account B.
  2. Add the desired amount and click "Next."
  3. Search for Account B and request the money.
  4. Close Account A by navigating to the security settings and clicking on "Close Account" with your email.
  5. Wait 10 seconds and reopen Account A.
  6. Check that the last request is canceled and the balance is 0.00.
  7. Navigate to the plus sign and select "Split Bill."
  8. Add the desired amount and click "Next."
  9. Select Account B to split the bill with.

    The expected result:-

    money should be successfully split between the two parties

    The actual result:-

    Unexpected error occurs while splitting the bill, even after closing and reopening the account with the same email

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

Version Number: 1.3.24-4 Reproducible in staging?: y Reproducible in production?: y 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 Notes/Photos/Videos: Any additional supporting documentation screen-capture (51).webm

https://github.com/Expensify/App/assets/43996225/2ced1695-e988-49a2-8ab4-8af7a6d677c6

Expensify/Expensify Issue URL: Issue reported by: @tewodrosgirmaa Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1685643489148699

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012c0616fb4594d680
  • Upwork Job ID: 1669290351620509696
  • Last Price Increase: 2023-06-15
melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @conorpendergrast (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

conorpendergrast commented 1 year ago

Tested with: Account A: conor+20303A@expensifail.com Account B: conor+20303B@expensifail.com

No error, split correctly:

image
tewodrosGirmaA commented 1 year ago

Hi @conorpendergrast

melvin-bot[bot] commented 1 year ago

📣 @tewodrosGirmaA! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
conorpendergrast commented 1 year ago

Tested with: 20303a@conorpendergrast.com 20303b@conorpendergrast.com

Same again! Successfully able to split after closing and reopening 20303a@conorpendergrast.com

image
conorpendergrast commented 1 year ago

I also tested what it looks like in the video above, by closing 20303a@conorpendergrast.com, and then splitting the bill while signed in with 20303b@conorpendergrast.com (with 20303a@conorpendergrast.com still closed), but that still successfully split the bill.

image
conorpendergrast commented 1 year ago

I'm pretty stumped by this one! @tewodrosGirmaA did you have anything that you could add here to clarify the reproduction steps?

tewodrosGirmaA commented 1 year ago

Hi @conorpendergrast
it is a long process and Did you follow this step:-
Action Performed:

  1. Log in to Account A and navigate to the plus sign at the bottom to request money from Account B.
  2. Add the desired amount and click "Next."
  3. Search for Account B and request the money.
  4. Close Account A by navigating to the security settings and clicking on "Close Account" with your email.
  5. Wait 10 seconds and reopen Account A.
  6. Check that the last request is canceled and the balance is 0.00.
  7. Navigate to the plus sign and select "Split Bill."
  8. Add the desired amount and click "Next."
  9. Select Account B to split the bill with.
tewodrosGirmaA commented 1 year ago

image

conorpendergrast commented 1 year ago

Yes, I followed those exact steps twice, without any error at all

tewodrosGirmaA commented 1 year ago

Based on the screenshot you shared, it seems that the initial request was not cancelled by the app as it should have been. However, I am unsure of the reason behind this issue

conorpendergrast commented 1 year ago

@tewodrosGirmaA Huh, what makes it look like the initial request wasn't cancelled correctly?

tewodrosGirmaA commented 1 year ago

Hi @conorpendergrast image

tewodrosGirmaA commented 1 year ago

I apologize for the confusion, but I did not see any notification indicating that the action was cancelled in the screenshots image

conorpendergrast commented 1 year ago

@tewodrosGirmaA Ah, that was inside the IOU, not in the "main" chat between 20303a@conorpendergrast.com and 20303b@conorpendergrast.com:

image
conorpendergrast commented 1 year ago

One last test: 20303c@conorpendergrast.com sent a request to 20303b@conorpendergrast.com

After closing 20303c@conorpendergrast.com:

image

And then sending a split bill from 20303c@conorpendergrast.com to 20303b@conorpendergrast.com:

image

So overall, seems like it all worked, weirdly

tewodrosGirmaA commented 1 year ago

I see, now I understand, @conorpendergrast. Thank you

conorpendergrast commented 1 year ago

So you're still able to reproduce this correct @tewodrosGirmaA?

tewodrosGirmaA commented 1 year ago

screen-capture (85).webm Well, I've tried reproducing it and it's still giving me grief. It's like the app has a mind of its own and is determined to drive me crazy! 🤯

conorpendergrast commented 1 year ago

Alright, I was able to find internal logs for isaacashenafi23@gmail.com that show this happening, so we're at least getting somewhere!

Specifically, the error we're seeing is in these internal logs, where what we're trying to do is:

Processing 'PayMoneyRequest' for 'expensify.com' from '95.85.63.9' ~~ command: 'PayMoneyRequest' iouReportID: '206443401677525' chatReportID: '3747912660948463' reportActionID: '6789614094871891257' paymentMethodType: 'Elsewhere' appversion: '1.3.26-1' 

And the error we're getting back is:

 Throw ExpException - d1cbd3c64a46b9acc503d06b59a1e863 ~~ message: '406 You can't pay another user's IOU' exceptionMessage: 'Auth PayMoneyRequest returned an error' exceptionFile: '/git/releases/expensify.com/3a24848/lib/Auth.php' exceptionLine: '124' exceptionCode: '406'
conorpendergrast commented 1 year ago

It's not reproducible, and at least we have the answer for what the error is! (406 You can't pay another user's IOU). I'm going to move this Internal so we can work out some more details, and to confirm if we need to fix this internal or it can be fixed external. Thanks for persisting with me @tewodrosGirmaA!

melvin-bot[bot] commented 1 year ago

Job added to Upwork: https://www.upwork.com/jobs/~012c0616fb4594d680

melvin-bot[bot] commented 1 year ago

Triggered auto assignment to Contributor Plus for review of internal employee PR - @thesahindia (Internal)

melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @mountiny (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

conorpendergrast commented 1 year ago

Oh yes, Internal didn't assign an engineer until today :)

mountiny commented 1 year ago

There was one APi change recently which might help with this so I would wait and try to retest later in the week if this is still reproducible. It was overwriting the reportIDs to incorrect reportIDs which this might be similar to as the error signals that a wrong iou report has been passed to the PayMoneyRequest

conorpendergrast commented 1 year ago

@mountiny Thanks! Do you have a link to that API change? I'll put this on hold for that being on production and then I'll re-test

mountiny commented 1 year ago

This PR its in staging now. Lets wait for another deploy and we can retest again.

melvin-bot[bot] commented 1 year ago

@conorpendergrast @mountiny @thesahindia this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

mountiny commented 1 year ago

Forgot to paste the link, apologies https://github.com/Expensify/Web-Expensify/pull/37809

conorpendergrast commented 1 year ago

Nice, that's on Production now, so this issue is ready to re-test today

conorpendergrast commented 1 year ago

Actually, given I was never able to reproduce this, @tewodrosGirmaA can you try reproducing again?

tewodrosGirmaA commented 1 year ago

Hi @conorpendergrast, the bug I reported is not present in the new version. Thanks

conorpendergrast commented 1 year ago

Ok, fantastic. I'll pay you out as the bug reporter (it's a different bug to https://github.com/Expensify/App/issues/16105, with the same fix).

conorpendergrast commented 1 year ago

Offer sent https://www.upwork.com/nx/wm/offer/25168088

tewodrosGirmaA commented 1 year ago

Thank you @conorpendergrast, I accepted the offer.

conorpendergrast commented 1 year ago

Paid, contract ended. All done, and thanks again for your help with all of the testing steps @tewodrosGirmaA!