Skip to content
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-16] After accessing the Who's your card provider? page from a specific bank, going back brings you to the bank list #53507

Closed
2 of 8 tasks
m-natarajan opened this issue Dec 4, 2024 · 12 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Dec 4, 2024

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?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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
Expensify/Expensify Issue URL:
Issue reported by: @joekaufmanexpensify
Slack conversation (hyperlinked to channel name): ts_external_expensify_expense

Action Performed:

  1. Enable company card in workspace
  2. Click Add card
  3. Choose any bank and click Next
  4. Choose any feed type and click Next
  5. Click the back arrow in the Who's your provider page

Expected Result:

User should be returned to the specific bank page they had selected previously, maintaining their context and choice.

Actual Result:

User returned to Who's your bank page

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
2024-12-02_16-18-46.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @slafortune
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 4, 2024
Copy link

melvin-bot bot commented Dec 4, 2024

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.

@nyomanjyotisa
Copy link
Contributor

nyomanjyotisa commented Dec 4, 2024

Edited by proposal-police: This proposal was edited at 2024-12-04 02:28:01 UTC.

Proposal

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

After accessing the Who's your card provider? page from a specific bank, going back brings you to the bank list

What is the root cause of that problem?

On this handleBackButtonPress, we navigate the user to SELECT_BANK instead of SELECT_FEED_TYPE

const handleBackButtonPress = () => {
CompanyCards.setAddNewCompanyCardStepAndData({step: CONST.COMPANY_CARDS.STEP.SELECT_BANK});
};

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

Change the handleBackButtonPress to this

    const handleBackButtonPress = () => {
        if (isOtherBankSelected) {
            CompanyCards.setAddNewCompanyCardStepAndData({step: CONST.COMPANY_CARDS.STEP.SELECT_BANK});
        } else {
            CompanyCards.setAddNewCompanyCardStepAndData({step: CONST.COMPANY_CARDS.STEP.SELECT_FEED_TYPE});
        }
    };

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

POC

New-Expensify-iOS-2.mp4

@saifelance
Copy link

Proposal

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

When navigating back from the "Who’s your provider?" page, the user is returned to the general bank list instead of the specific bank page they had previously selected. This disrupts the user flow by not maintaining the selected bank context.

What is the root cause of that problem?

The back navigation logic (handleBackButtonPress) resets the navigation step to the general bank list (SELECT_BANK) without preserving the selectedBank context, resulting in a loss of the user's previously selected bank information.

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

  1. Update the handleBackButtonPress logic to pass the selectedBank and any other necessary data to maintain the user context.
  2. Modify the setAddNewCompanyCardStepAndData function to ensure the selected bank information is preserved when navigating back.
  3. Ensure that all navigation states and conditions account for the user's previously selected choices.

App/src/pages/workspace/companyCards/addNew/CardTypeStep.tsx

const handleBackButtonPress = () => {
    CompanyCards.setAddNewCompanyCardStepAndData({
        step: CONST.COMPANY_CARDS.STEP.SELECT_BANK,
        data: {
            ...addNewCard?.data, // Preserve existing data
            selectedBank,       // Retain the selected bank
        },
    });
};

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

  1. Valid Bank Selection: Verify that navigating back from the "Who’s your provider?" page returns the user to the previously selected bank page.
  2. Invalid Bank Selection: Test back navigation without selecting a bank to ensure it returns to the bank list with no preselection.
  3. State Retention: Confirm selectedBank is retained across navigations and back actions.
  4. UI State Validation: Ensure UI elements linked to selectedBank update correctly during transitions.

What alternative solutions did you explore? (Optional)

  1. State Management: Use Redux/Context for global state consistency, though more complex.
  2. URL Navigation: Add selectedBank to route parameters for persistent state.
  3. Breadcrumb Navigation: Use breadcrumbs for clearer flow and accurate back navigation.
  4. The chosen approach—preserving selectedBank—is simpler and fits seamlessly with existing logic.

@narefyev91
Copy link
Contributor

Hi, I'm Nicolay from Callstack - expert contributor group - and I would like to work on this issue.

@dukenv0307
Copy link
Contributor

I already worked on company card project so I would like to take it as C+

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Dec 4, 2024
@mountiny mountiny moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Dec 4, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 9, 2024
@melvin-bot melvin-bot bot changed the title After accessing the Who's your card provider? page from a specific bank, going back brings you to the bank list [HOLD for payment 2024-12-16] After accessing the Who's your card provider? page from a specific bank, going back brings you to the bank list Dec 9, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 9, 2024
Copy link

melvin-bot bot commented Dec 9, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Dec 9, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.72-1 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-16. 🎊

For reference, here are some details about the assignees on this issue:

  • @narefyev91 does not require payment (Contractor)
  • @dukenv0307 requires payment through NewDot Manual Requests

Copy link

melvin-bot bot commented Dec 9, 2024

@dukenv0307 @slafortune @dukenv0307 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]

@garrettmknight garrettmknight moved this from Bugs and Follow Up Issues to Hold for Payment in [#whatsnext] #expense Dec 10, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 16, 2024
@melvin-bot melvin-bot bot added the Overdue label Dec 16, 2024
Copy link

melvin-bot bot commented Dec 16, 2024

Payment Summary

Upwork Job

  • Contributor: @narefyev91 is from an agency-contributor and not due payment
  • Reviewer: @dukenv0307 owed $250 via NewDot

BugZero Checklist (@slafortune)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@dukenv0307
Copy link
Contributor

dukenv0307 commented Dec 17, 2024

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    Link to comment: https://github.com/Expensify/App/pull/51997/files#r1888729124

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

    Link to discussion: N/A

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again. Yes

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Test:

  • Test case 1:
  1. Enable company card in workspace
  2. Click Add card
  3. Choose any bank (except Other) and click Next
  4. Choose any feed type and click Next
  5. Click the back arrow in the Who's your provider page
  6. Verify that user goes back to feed type
  • Test case 2:
  1. Enable company card in workspace
  2. Click Add card
  3. Choose Other bank and click Next
  4. Click the back arrow in the Who's your provider page
  5. Verify that user goes back to select bank screen

Do we agree 👍 or 👎

@slafortune
Copy link
Contributor

Contributor: @narefyev91 is from an agency-contributor and not due payment
Reviewer: @dukenv0307 owed $250 via NewDot

@github-project-automation github-project-automation bot moved this from Hold for Payment to Done in [#whatsnext] #expense Dec 18, 2024
@melvin-bot melvin-bot bot removed Overdue labels Dec 18, 2024
@dukenv0307
Copy link
Contributor

@slafortune It belongs to WS Feed, so no need payment for me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
Status: Done
Development

No branches or pull requests

7 participants