-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$250] Wallet - "It's not here" error is briefly shown when deactivating a virtual card #53996
Comments
Triggered auto assignment to @JmillsExpensify ( |
Job added to Upwork: https://www.upwork.com/jobs/~021867191340390551829 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov ( |
@izarutskaya Video of reproducing bug is not playing. |
@koko57 would you want to work on this? |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
It will set the card data to null: Line 55 in 258e2be
and then call:
which will set the card data to
the navigation action needs time to process. Meanwhile, we display the not found page since BE has set the card data to null: App/src/pages/settings/Wallet/ReportVirtualCardFraudPage.tsx Lines 84 to 86 in 258e2be
What changes do you think we should make in order to solve the problem?
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?What alternative solutions did you explore? (Optional)
to:
and
to:
|
Hi! I'm Bartek from Callstack - expert contributor group. I’d like to work on this issue (if you decide to decline the above proposal, of course). |
@JmillsExpensify, @mountiny, @alitoshmatov Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@truph01 Thank you for your proposal. In your RCA you are mentioning that |
@truph01 Correction: Okay I think Edit:
We already have a loading button, we don't want to introduce another loading screen just to appear for a small amount of time when navigation is happening |
Based on C+ doc, since existing proposal is not selected we can assign @burczu to this issue and wait for their proposal |
@alitoshmatov Thanks for your feedback! I have a question regarding your point above: Why do you think my alternative solution would break the app? It simply shows a loading state in the button during navigation. |
@truph01 Did you tested your alternative solution?
We have a usage of virtualCard here. To be fair this small issue and could be fixed easily. But I am still in doubt about isNavigating state, I haven't seen similar use case in other places
|
App/src/pages/settings/Profile/CustomStatus/StatusPage.tsx Lines 93 to 95 in a5913b9
|
@burczu please go ahead |
ProposalPlease re-state the problem that we are trying to solve in this issue.The "It's not here" 404 page is shown for a short period of time after successfully deactivating a virtual card and before redirecting back. What is the root cause of that problem?To root cause of the problem is that we rely on existence of the virtual card inside the list of cards when deciding if we need to show the "It's not there" page or not: App/src/pages/settings/Wallet/ReportVirtualCardFraudPage.tsx Lines 84 to 86 in c45f834
where the
The problem is, that when we call the What changes do you think we should make in order to solve the problem?To prevent this, we could store the copy of the const virtualCard = cardList?.[cardID];
const virtualCardRef = useRef(virtualCard);
...
if (isEmptyObject(virtualCardRef?.current)) {
return <NotFoundPage />;
} Thanks to these changes, we prevent showing the 404 error page after the API call is successful, even that the card is already removed from the list of cards. And it will still work for the original purpose of this part of code - if we open the page with incorrect What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?What alternative solutions did you explore? (Optional)n/a Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
@alitoshmatov thoights? |
@burczu does this also mean that if i am looking at the page as admin 1 and admin 2 deactivates this card, the pusher event will come in but i as admin 1 will still see the card as if it was not deleted? |
@mountiny Hmm... I didn't consider this scenario... I'll test it today and if it is the case, I'll work on addressing it. |
I am not sure if its critical, these dynamic bugs are hard to handle, but feels like this might be the case with the prosed changes |
I am not sure why but I don't think this approach is correct, we shouldn't have a copy of data just for the sake of solving slow navigation. If we needed it, then we should have set up our logic so that data be deleted after navigation happens. Also if data is set to null optimistically why wait for api request, based on the code shouldn't App/src/pages/settings/Wallet/ReportVirtualCardFraudPage.tsx Lines 84 to 86 in 0bf6d8c
|
@alitoshmatov Even without setting it optimistically, its the API response that sets it to |
@mountiny I think the scenario you was worrying about is impossible - from what I see, every user can report fraud only of its own cards in the wallet, so it's impossible that another admin can see the same report fraud page at the same time. But maybe I'm missing something? |
@alitoshmatov I've tried removing optimistically clearing card data in the list of cards but it does not fix the issue - the 404 page still shows up, but for shorter period. I've also gave a try once again the solution I've described in my previous comment but unfortunately without success - the navigation finishes earlier than the animation so the 404 page is visible for some short time. I think, as we can't react to the end of the animation (at least I couldn't find the way to do it), the only solution must be kinda hack-ish - I agree it's not perfect. If we don't like storing the copy of the data inside the |
Auto-assign attempt failed, all eligible assignees are OOO. |
I kind feel like this flow is a bit weird When i actually want to report fraud on my card, i am probably worried about abuse of the card. I would like to get clear feedback the card was successfully terminated and it could not be abused by anyone. @JmillsExpensify @Expensify/design what do you this about showing some success screen after the card is deactivated? This would provide clear feedback to the user and fix this bug as well. We could also further improve the success screen by directly adding not only "ok" button, but a CTA to create a new card (if you are admin) What do you think? |
@JmillsExpensify, @burczu, @mountiny, @alitoshmatov Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@JmillsExpensify @burczu @mountiny @alitoshmatov this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number:
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team
Slack conversation (hyperlinked to channel name):
Action Performed:
Precondition: Use a Gmail member account that has a single assigned virtual Expensify Card.
Expected Result:
I should be getting a proper error message at the bottom of the RHP.
Actual Result:
"It's not here" error is briefly shown when deactivating a virtual card.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6689664_1733809758992.bandicam_2024-12-10_06-43-16-080.mp4
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @alitoshmatovThe text was updated successfully, but these errors were encountered: