-
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
[HOLD for payment 2024-12-20] [$250] Expensify Card - Empty card details page can be opened after deactivating card #53560
Comments
Triggered auto assignment to @alexpensify ( |
Edited by proposal-police: This proposal was edited at 2024-12-04 15:10:12 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Expensify Card - Empty card details page can be opened after deactivating card What is the root cause of that problem?When card is deactivated
And we are not showing not found page when card is undefiend What changes do you think we should make in order to solve the problem?We should pass shouldBeBlocked={!card} to AccessOrNotFoundWrapper, or we can use isEmptyObject(card) optionally
And we should close the modal when back button is clicked by passing navigation.dismissModal function to onBackButtonPress prop or fullPageNotFoundViewProps
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?What alternative solutions did you explore? (Optional) |
expensify/ExpensiFlex Your proposal will be dismissed because you did not follow the proposal template. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Expensify Card - Empty card details page can be opened after deactivating card What is the root cause of that problem?We haven't restricted access to the detail card page if a user tries to view an invalid card What changes do you think we should make in order to solve the problem?In WorkspaceExpensifyCardDetailsPage we need to implement the same logic as we did in WorkspaceCompanyCardDetailsPage
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?What alternative solutions did you explore? (Optional)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. |
@mountiny This seems like a lack of when implementing this feature. Could I take over this one? |
ProposalPlease re-state the problem that we are trying to solve in this issue.Empty card details page can be opened after deactivating card What is the root cause of that problem?There is no blocking screen in Expensify cards page in case the cardID doesn't exist in the list. hence we still see the details page for any cardID eg What changes do you think we should make in order to solve the problem?We would need to make 2 changes here.
if (!card && !isLoadingOnyxValue(cardsListMetadata)) {
return <NotFoundPage />;
}
Lines 619 to 633 in e25e3fa
Note that fixing this is necessary else we will see a not found page everytime the user deactives the card before the RHP closes, so we will update const optimisticData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}${workspaceAccountID}_${CONST.EXPENSIFY_CARD.BANK}`,
value: {
[cardID]: {
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
},
},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.CARD_LIST,
value: {
[cardID]: {
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
},
},
},
];
const successData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}${workspaceAccountID}_${CONST.EXPENSIFY_CARD.BANK}`,
value: {
[cardID]: null,
},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.CARD_LIST,
value: {
[cardID]: null,
},
}
] What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A this is a visual bug so no tests required What alternative solutions did you explore? (Optional)N/A |
yeah if the cardId is not locally we should show not found page |
@DylanDylann can you please review my proposal here |
@thelullabyy's proposal looks good to me @twilight2294 I noticed that you mentioned another bug in your proposal: "When deactivating the card, the card is removed before the modal is dismissed. It caused the empty value to be displayed in a moment". But I believe that we shouldn't add @thelullabyy Let's also resolve this additional bug in your PR. One potential approach that we already used widely in our codebase is to deactivate the card after the modal is closed completely by using runAfterInteractions. 🎀 👀 🎀 C Reviewed |
Current assignee @mountiny is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
@DylanDylann we follow the pattern i suggested in company cards page when we deactive the card: App/src/libs/actions/CompanyCards.ts Lines 250 to 260 in 840c227
So i don't understand why cannot we use it in expensify cards page ? Can you please re-review my proposal ? @mountiny can you also please check, my proposal already works the way company cards page works so i think it is fine to put the optimistic pending action |
@twilight2294 I just checked again
It isn't the same. |
@DylanDylann , we follow pattern B for Line 417 in e25e3fa
Lines 487 to 490 in e25e3fa
Lines 555 to 558 in e25e3fa
So i guess for the details page too, pattern B should be followed similar to company cards details page |
@twilight2294 No, the company cards is a simple update in our database hence pattern B but for anything related to Expensify card we also need to communication with thirdparty api and that can fail for unknown reasons hence we only want users to be able to do take these critical actions online |
Job added to Upwork: https://www.upwork.com/jobs/~021865065766629964229 |
Current assignee @DylanDylann is eligible for the External assigner, not assigning anyone new. |
@alexpensify, @mountiny, @DylanDylann, @thelullabyy Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@DylanDylann I created a draft PR, I just need to test and finish all videos before opening to review. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.75-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-12-20. 🎊 For reference, here are some details about the assignees on this issue:
|
@DylanDylann @alexpensify @DylanDylann The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
Payment Summary
BugZero Checklist (@alexpensify)
|
@thelullabyy - I'm having trouble finding you in Upwork. Please apply for the job in Upwork, and I can complete the payment process. Thanks! |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test ProposalPrecondition:
Test:
Do we agree 👍 or 👎 |
@alexpensify Applied! |
Thanks, I've sent offers to @thelullabyy and @DylanDylann in Upwork. Please accept and I can complete the payment process. |
@alexpensify Accepted, ty! |
All set and closing, everyone has been paid via Upwork. Since I'm OOO until January 3, I'm going to close and work on the QA step when I'm back online. |
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.71-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): applausetester [email protected]
Issue reported by: Applause Internal Team
Action Performed:
Precondition:
Expected Result:
Not here page should open because the card is deactivated.
Actual Result:
Empty card details page opens. It can be edited, which leads to "Hidden" profile in Expensify Card list.
Workaround:
Unknown
Platforms:
Screenshots/Videos
bug.mp4
View all open jobs on GitHub
Issue Owner
Current Issue Owner: @Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @alexpensifyThe text was updated successfully, but these errors were encountered: