App icon indicating copy to clipboard operation
App copied to clipboard

[$250] [Workspace Feeds] Auth RequestReplacementExpensifyCard returned an error when deactivating card

Open IuliiaHerets opened this issue 1 year ago β€’ 66 comments

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: 9.0.46-1 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. [Admin] Asssign a virtual card to member.
  3. [Admin] Go to Expensify Card.
  4. [Admin] Click on the member with the virtual card in Step 2.
  5. [Admin] Change the limit to 0.00
  6. [Member] Go to Wallet.
  7. [Member] Click on the Expensify Card.
  8. [Member] Click Report virtual card fraud.
  9. [Member] Click Deactivate card.

Expected Result:

The error message should be a proper error message.

Actual Result:

The error message is Auth RequestReplacementExpensifyCard returned an error.

Workaround:

Unknown

Platforms:

  • [x] Android: Native
  • [x] Android: mWeb Chrome
  • [x] iOS: Native
  • [x] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [x] MacOS: Desktop

Screenshots/Videos

https://github.com/user-attachments/assets/735968bd-64a8-44a5-87cf-0ab58089552c

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021844041896258257372
  • Upwork Job ID: 1844041896258257372
  • Last Price Increase: 2024-10-09
Issue OwnerCurrent Issue Owner: @koko57

IuliiaHerets avatar Oct 08 '24 10:10 IuliiaHerets

Triggered auto assignment to @slafortune (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

melvin-bot[bot] avatar Oct 08 '24 10:10 melvin-bot[bot]

We think that this bug might be related to #wave-collect - Release 2

IuliiaHerets avatar Oct 08 '24 10:10 IuliiaHerets

@slafortune FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

IuliiaHerets avatar Oct 08 '24 10:10 IuliiaHerets

Edited by proposal-police: This proposal was edited at 2024-10-08 11:13:38 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

Auth RequestReplacementExpensifyCard returned an error when deactivating card

What is the root cause of that problem?

We are not showing generic error when a request fails https://github.com/Expensify/App/blob/867bbb47782c817fa682196394b9ee6ef217e519/src/libs/actions/Card.ts#L109-L116

What changes do you think we should make in order to solve the problem?

We can add errorsErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('common.genericErrorMessage'), in failure data https://github.com/Expensify/App/blob/867bbb47782c817fa682196394b9ee6ef217e519/src/libs/actions/Card.ts#L109-L116

Alternatively, we can display a custom error message by adding it to the en.ts or es.ts file.

What alternative solutions did you explore? (Optional)

Nodebrute avatar Oct 08 '24 10:10 Nodebrute

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

melvin-bot[bot] avatar Oct 09 '24 15:10 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)

melvin-bot[bot] avatar Oct 09 '24 15:10 melvin-bot[bot]

This needs better error handling, when the card is deactivated we send the onyx update to remove the card, but it might take longer so the user was still able to see the card there

mountiny avatar Oct 09 '24 23:10 mountiny

@koko57 would you be able to look as well? I can see that the updates are being queued to remove the card from Onyx, but it seems like it's not being applied correctly/ re-rendered.

I will need to look more later too

mountiny avatar Oct 09 '24 23:10 mountiny

@mountiny yeah, of course I will take a look. If any other problems with Expensify Card will be found, ping me please, I can take care of them

koko57 avatar Oct 10 '24 06:10 koko57

If you find this needs to be addressed in BE, then please ping me in slack πŸ™Œ

mountiny avatar Oct 10 '24 08:10 mountiny

@mountiny Sorry for the delay here - I just checked this flow and looks like we're getting this message from the BE Screenshot 2024-10-11 at 13 33 12

I'll check if we're handling it somehow on the FE, but still the BE message would need to be changed.

koko57 avatar Oct 11 '24 06:10 koko57

From the logs, its because the account does not have the legal first name set, but I think we do not have this restriction when creating a new virtual card. We should add better error handling for sure.

mountiny avatar Oct 14 '24 10:10 mountiny

The problem here is that the card was in a deactivated state when you tried to get a new one; they took the action very fast, so the pusher update did not come in. Normally, the card would be removed from Onyx, and they could not go to the details. In this case I guess the best option is just to handle the error better so it says the card was deactivated

mountiny avatar Oct 14 '24 11:10 mountiny

@eVoloshchak, @slafortune, @koko57, @mountiny Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Oct 15 '24 18:10 melvin-bot[bot]

@mountiny any changes required from the FE side?

koko57 avatar Oct 16 '24 03:10 koko57

I think we should do the same as when creating the card and show a spinner when the replacement card is requested until we get a response and then show an error in case there was one

mountiny avatar Oct 16 '24 04:10 mountiny

I will try to handle the errors nicer in backend

mountiny avatar Oct 16 '24 04:10 mountiny

@eVoloshchak, @slafortune, @koko57, @mountiny 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] avatar Oct 17 '24 18:10 melvin-bot[bot]

On my list

mountiny avatar Oct 18 '24 03:10 mountiny

Still on my list

mountiny avatar Oct 21 '24 10:10 mountiny

@eVoloshchak @slafortune @koko57 @mountiny 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!

melvin-bot[bot] avatar Oct 22 '24 18:10 melvin-bot[bot]

Started a draft, will need to test more

mountiny avatar Oct 23 '24 12:10 mountiny

Web Pr is in staging

mountiny avatar Oct 24 '24 05:10 mountiny

@koko57 the error response shape now should be image

Can you please update the flow to handle the error and show it under the button when the user tries to replace the card?

mountiny avatar Oct 24 '24 05:10 mountiny

Is this one done?

muttmuure avatar Oct 29 '24 16:10 muttmuure

Deployed to Web-Expensify/production 5 days ago πŸ‘ @koko57 did you address this comment?

slafortune avatar Oct 29 '24 16:10 slafortune

@eVoloshchak, @slafortune, @koko57, @mountiny Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] avatar Oct 29 '24 18:10 melvin-bot[bot]

@slafortune @mountiny Sorry, I've somehow missed the notification for this issue πŸ™‡πŸ» I'll try to address this today, if I won't manage to do that I'll ask someone from my team (as I'll be ooo tomorrow)

koko57 avatar Oct 30 '24 10:10 koko57

np

mountiny avatar Oct 30 '24 13:10 mountiny

@mountiny will try to fix this today - can you help to understand what exactly we try to fix here? Just to show correct message under the button - "Cannot replace card that has no limit set"?

narefyev91 avatar Oct 31 '24 07:10 narefyev91