Skip to content

[Due for payment 2025-06-05] [$250] Web - Company cards - User stays on member profile tab instead Company cards page #56009

Closed

Description

@IuliiaHerets

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: v9.0.91-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/cases/view/3809610
Email or phone of affected tester (no customers): applausetester+ccardfeed@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Windows 11 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition: workspace with several members, with enabled Company cards. Some company cards are added.

  1. Go to ws > Members
  2. Click on member with already assigned company card (if no, assign card to member)
  3. Click on 'New card'
  4. Proceed to the 4th step 'Let’s double check that everything looks right.'
  5. Click on Cardholder field
  6. Select another ws member
  7. Click 'Assign card'

Expected Result:

User lands to Company cards page, rather than the workspace member profile he was previously on (as you assigned the card to someone else)

Actual Result:

User stays on member's (from step 2) profile tab

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6727880_1738182016138.bandicam_2025-01-29_22-07-17-203.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021884789970763850893
  • Upwork Job ID: 1884789970763850893
  • Last Price Increase: 2025-01-30
  • Automatic offers:
    • twilight2294 | Contributor | 106071043
Issue OwnerCurrent Issue Owner: @jliexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 29, 2025
  2. melvin-bot commented on Jan 29, 2025

    @melvin-bot

    Triggered auto assignment to @jliexpensify (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.

  3. nyomanjyotisa commented on Jan 29, 2025

    @nyomanjyotisa
    Member

    🚨 Edited by proposal-police: This proposal was edited at 2025-01-30 01:09:50 UTC.

    Proposal

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

    User stays on member profile tab instead Company cards page

    What is the root cause of that problem?

    The navigation inconsistency stems from the use of the backTo parameter, which defaults to redirecting users to the originating page (e.g., a members page) instead of enforcing a consistent post-submission path to the company cards page.

    const submit = () => {
    if (!policyID) {
    return;
    }
    CompanyCards.assignWorkspaceCompanyCard(policyID, data);
    Navigation.navigate(backTo ?? ROUTES.WORKSPACE_COMPANY_CARDS.getRoute(policyID));
    CompanyCards.clearAssignCardStepAndData();
    };

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

    Change the submit function to always navigate to WORKSPACE_COMPANY_CARDS after submission

        const submit = () => {
            if (!policyID) {
                return;
            }
            CompanyCards.assignWorkspaceCompanyCard(policyID, data);
            Navigation.navigate(ROUTES.WORKSPACE_COMPANY_CARDS.getRoute(policyID));  
            CompanyCards.clearAssignCardStepAndData();
        };

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

    N/A

    What alternative solutions did you explore? (Optional)

    N/A

  4. github-actions commented on Jan 29, 2025

    @github-actions
    Contributor

    ⚠️ @nyomanjyotisa Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 30, 2025
  6. changed the title [-]Web - Company cards - User stays on member profile tab instead Company cards page[/-] [+][$250] Web - Company cards - User stays on member profile tab instead Company cards page[/+] on Jan 30, 2025
  7. melvin-bot commented on Jan 30, 2025

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 30, 2025
  9. melvin-bot commented on Jan 30, 2025

    @melvin-bot

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

  10. twilight2294 commented on Jan 30, 2025

    @twilight2294
    Contributor

    Proposal

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

    User stays on member profile tab instead Company cards page

    What is the root cause of that problem?

    We are expected to go back to the members page if the card is assigned to the same member from whose profile page we clicked assign cards, but in the current navigation condition, we navigate to the members profile page regardless of the card being assigned to the same / different member:

    const submit = () => {
    if (!policyID) {
    return;
    }
    CompanyCards.assignWorkspaceCompanyCard(policyID, data);
    Navigation.navigate(backTo ?? ROUTES.WORKSPACE_COMPANY_CARDS.getRoute(policyID));
    CompanyCards.clearAssignCardStepAndData();
    };

    There is not check to see if the same member was assigned the card.

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

    According to op:

    User lands to Company cards page, rather than the workspace member profile he was previously on (as you assigned the card to someone else)

    To achieve this, we need to compare the accountID from the backTo param to the currently selected users accountID:

    1. Firstly in ConfirmationStep we need to extract the accountID from the backTo param to get the workspace member from where we initially navigated accountID:
      function ConfirmationStep({policyID, backTo}: ConfirmationStepProps) {
    const workspaceMemberAccountID = backTo?.split('/').at(-1);
    1. Then we need to get the accountID for the user who is current being getting the card assigned:
      const cardholderName = PersonalDetailsUtils.getPersonalDetailByEmail(data?.email ?? '')?.displayName ?? '';
        const cardholderAccountID = PersonalDetailsUtils.getPersonalDetailByEmail(data?.email ?? '')?.accountID.toString() ?? '';
    1. Then we need to update the submit step:
        const submit = () => {
            if (!policyID) {
                return;
            }
            CompanyCards.assignWorkspaceCompanyCard(policyID, data);
            if (backTo) {
                Navigation.navigate(workspaceMemberAccountID === cardholderAccountID ? backTo : ROUTES.WORKSPACE_COMPANY_CARDS.getRoute(policyID));
            } else {
                Navigation.navigate(ROUTES.WORKSPACE_COMPANY_CARDS.getRoute(policyID));
            }
    
            CompanyCards.clearAssignCardStepAndData();
        };

    The above conditions can be improved including the extraction of workspaceMemberAccountID during PR phase

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

    N/A this is a navigation bug

    What alternative solutions did you explore? (Optional)

  11. s77rt commented on Jan 30, 2025

    @s77rt
    Member

    Hi! Thanks for the proposals. I think we need to align on the expected behaviour first and whether this is something we need to actually fix.

    Here a slack thread https://expensify.slack.com/archives/C01GTK53T8Q/p1738245718538879

  12. 59 remaining items

  13. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on May 29, 2025
  14. changed the title [-][$250] Web - Company cards - User stays on member profile tab instead Company cards page[/-] [+][Due for payment 2025-06-05] [$250] Web - Company cards - User stays on member profile tab instead Company cards page[/+] on May 29, 2025
  15. melvin-bot commented on May 29, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.53-7 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 2025-06-05. 🎊

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

  16. melvin-bot commented on May 29, 2025

    @melvin-bot

    @s77rt @jliexpensify @s77rt 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]

  17. s77rt commented on May 31, 2025

    @s77rt
    Member

    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 (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. 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: [No QA] [Workspace Feeds] Clean up for workspace feeds #48323 (comment)

    • [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.

      Bug requires regression test: No, this is already came from a test

  18. jliexpensify commented on Jun 1, 2025

    @jliexpensify
    Contributor

    Payment Summary

    • C: @twilight2294 (to be paid via Upworks) - please accept offer
    • C+: @s77rt $250 (to be paid via New Expensify requests)

    NEW UPWORKS JOB - https://www.upwork.com/jobs/~021929048197297762019

  19. twilight2294 commented on Jun 1, 2025

    @twilight2294
    Contributor

    @jliexpensify I accepted the offer

  20. jliexpensify commented on Jun 6, 2025

    @jliexpensify
    Contributor

    Paid in Upworks!

  21. JmillsExpensify commented on Jun 9, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @s77rt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions