[$250] [Workspace Feeds] Auth RequestReplacementExpensifyCard returned an error when deactivating card
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:
- Go to staging.new.expensify.com
- [Admin] Asssign a virtual card to member.
- [Admin] Go to Expensify Card.
- [Admin] Click on the member with the virtual card in Step 2.
- [Admin] Change the limit to 0.00
- [Member] Go to Wallet.
- [Member] Click on the Expensify Card.
- [Member] Click Report virtual card fraud.
- [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
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 Owner
Current Issue Owner: @koko57
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.
We think that this bug might be related to #wave-collect - Release 2
@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
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)
Job added to Upwork: https://www.upwork.com/jobs/~021844041896258257372
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)
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
@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 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
If you find this needs to be addressed in BE, then please ping me in slack π
@mountiny Sorry for the delay here - I just checked this flow and looks like we're getting this message from the BE
I'll check if we're handling it somehow on the FE, but still the BE message would need to be changed.
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.
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
@eVoloshchak, @slafortune, @koko57, @mountiny Huh... This is 4 days overdue. Who can take care of this?
@mountiny any changes required from the FE side?
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
I will try to handle the errors nicer in backend
@eVoloshchak, @slafortune, @koko57, @mountiny 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
On my list
Still on my list
@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!
Started a draft, will need to test more
Web Pr is in staging
@koko57 the error response shape now should be
Can you please update the flow to handle the error and show it under the button when the user tries to replace the card?
Is this one done?
Deployed to Web-Expensify/production 5 days ago π @koko57 did you address this comment?
@eVoloshchak, @slafortune, @koko57, @mountiny Eep! 4 days overdue now. Issues have feelings too...
@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)
np
@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"?