Skip to content

[HOLD for payment 2024-11-13] [$250] Expensify Card - "Add shipping details" button still appears when the card is deactivated #50693

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: 9.0.48-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): applausetester+kh081006@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • User has assigned a physical card to self.
  • Private details have not been added.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Expensify Card.
  3. Click on the Expensify Card that is assigned to yourself.
  4. Click Deactivate card.
  5. Deactivate the card.
  6. Go to workspace chat.

Expected Result:

"Add shipping details" button will not appear since the card is deactivated.

Actual Result:

"Add shipping details" button still appears when the card is deactivated.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6633297_1728811970050.20241013_172918.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021846577574853745828
  • Upwork Job ID: 1846577574853745828
  • Last Price Increase: 2024-10-16
  • Automatic offers:
    • hoangzinh | Reviewer | 104523414
    • truph01 | Contributor | 104523417
Issue OwnerCurrent Issue Owner: @hoangzinh

Activity

  1. added
    Daily
    Bug
    on Oct 13, 2024
  2. melvin-bot commented on Oct 13, 2024

    @melvin-bot

    Triggered auto assignment to @zanyrenney (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. IuliiaHerets commented on Oct 13, 2024

    @IuliiaHerets
    Author

    We think that this bug might be related to #wave-collect - Release 2

  4. IuliiaHerets commented on Oct 13, 2024

    @IuliiaHerets
    Author

    @zanyrenney 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

  5. truph01 commented on Oct 13, 2024

    @truph01
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-10-16 16:42:03 UTC.

    Proposal

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

    "Add shipping details" button still appears when the card is deactivated.

    What is the root cause of that problem?

    • We show the "Add shipping card" butotn without checking if the card is deactivated or not:

    const shouldShowAddMissingDetailsButton = action?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS && missingDetails && isAssigneeCurrentUser;

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

    • Should check whether the card is existed/actived or not:
      const cardIssuedActionOriginalMessage = ReportActionsUtils.isActionOfType(
            action,
            CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED,
            CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED_VIRTUAL,
            CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS,
        )
            ? ReportActionsUtils.getOriginalMessage(action)
            : undefined;
        const cardID = cardIssuedActionOriginalMessage?.cardID ?? -1;
        const isPolicyAdmin = PolicyUtils.isPolicyAdmin(PolicyUtils.getPolicy(policyID));
        const card = isPolicyAdmin ? cardsList?.[cardID] : cardList[cardID];
        const shouldShowAddMissingDetailsButton = !isEmptyObject(card) && action?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS && missingDetails && isAssigneeCurrentUser;
    
    

    What alternative solutions did you explore? (Optional)

  6. zanyrenney commented on Oct 14, 2024

    @zanyrenney
    Contributor

    Agreed, this button shouldn't be there!

  7. added
    External
    on Oct 16, 2024
  8. changed the title [-]Expensify Card - "Add shipping details" button still appears when the card is deactivated[/-] [+][$250] Expensify Card - "Add shipping details" button still appears when the card is deactivated[/+] on Oct 16, 2024
  9. melvin-bot commented on Oct 16, 2024

    @melvin-bot
  10. added
    Help Wanted
    on Oct 16, 2024
  11. melvin-bot commented on Oct 16, 2024

    @melvin-bot

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

  12. SWS-5007 commented on Oct 16, 2024

    @SWS-5007

    Hi, Here is my suggestion.

    1. Check card Status:
      Before rendering the "Add shipping details" button, we should check the status of the card if it is active or deactivated.
      We can add conditional statement that checks the card's activate status.

    2. Check Backend:
      We should ensure that Backend properly sends the card's status in the response.

    3. Modify Frontend:
      In the Frontend, we can update code handling the display of button like below:

    // Assuming `card` is the card object and `card.status` indicates if it's active
    const shouldShowAddShippingDetailsButton = (card) => {
        return card.status === 'active' && !card.hasShippingDetails;
    };
    
    if (shouldShowAddShippingDetailsButton(card)) {
        // Show the button
    } else {
        // Hide the button
    }
    
    1. Update Existing Logic:
      Maybe, we can add an additional condition in the existing card rendering functions or React Components.

    If we discuss more details about current issue and help me to check your codebase as soon, I can provide with better solution.
    Good luck!

  13. 23 remaining items

  14. melvin-bot commented on Nov 6, 2024

    @melvin-bot

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

  15. removed
    Reviewing
    on Nov 6, 2024
  16. melvin-bot commented on Nov 6, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.57-10 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-11-13. 🎊

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

  17. melvin-bot commented on Nov 6, 2024

    @melvin-bot

    @hoangzinh @zanyrenney 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]

  18. added
    Daily
    and removed
    Weekly
    on Nov 12, 2024
  19. zanyrenney commented on Nov 13, 2024

    @zanyrenney
    Contributor

    @hoangzinh please complete this as I can't do the payment until it is done. Thanks!

  20. zanyrenney commented on Nov 13, 2024

    @zanyrenney
    Contributor

    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 both staging and production
    • 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:

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

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

    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

    Precondition:

    Test:

    Do we agree 👍 or 👎

  21. hoangzinh commented on Nov 14, 2024

    @hoangzinh
    Contributor

    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: New requirement

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on both staging and production
    • 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: Nope, I think it's new requirement/scenario that we haven't covered before.

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

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

    Precondition:

    • User has assigned a physical card to self.
    • Private details have not been added.

    Test:

    1. Sign in to the above account
    2. Go to workspace settings > Expensify Card.
    3. Click on the Expensify Card that is assigned to you.
    4. Click Deactivate card.
    5. Deactivate the card.
    6. Go to workspace chat.
    7. Verify that the "Add shipping details" button will not appear since the card has been deactivated.

    Do we agree 👍 or 👎

  22. moved this from Bugs and Follow Up Issues to Hold for Payment in #expensify-bugson Nov 14, 2024
  23. zanyrenney commented on Nov 14, 2024

    @zanyrenney
    Contributor

    That regression test looks great, adding it now.

  24. zanyrenney commented on Nov 14, 2024

    @zanyrenney
    Contributor
  25. zanyrenney commented on Nov 14, 2024

    @zanyrenney
    Contributor

    payment summary

    @hoangzinh requires payment automatic offer (Reviewer) paid $250 via upwork.
    @truph01 requires payment automatic offer (Contributor) paid $250 via upwork.

  26. moved this from Hold for Payment to Done in #expensify-bugson Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions