Skip to content

[HOLD for payment 2024-12-30] [$250] 'Approve' Button Incorrectly Displayed for Pending Expensify Card Transactions #53101

Closed

Description

@m-natarajan

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?: Needs Reproduction
Reproducible in production?: Needs Reproduction
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: @shawnborton
Slack conversation (hyperlinked to channel name): ts_external_expensify_expense

Action Performed:

  1. Navigate to the Search page.
  2. Search for an expense associated with an Expensify Card transaction that is still in a pending state.
  3. Observe the expense row in the search results.

Expected Result:

The "Approve" button should not be displayed on the expense row for transactions in a pending state, The button should only appear when the transaction is actionable

Actual Result:

An "Approve" button is displayed for the pending transaction, even though no approval action can be taken at this stage and clicking the "Approve" button results in no action or feedback, as expected for a pending transaction.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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
CleanShot.2024-11-25.at.17.43.29.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021863621928114678264
  • Upwork Job ID: 1863621928114678264
  • Last Price Increase: 2024-12-09
  • Automatic offers:
    • paultsimura | Reviewer | 105276803
    • cretadn22 | Contributor | 105276806
Issue OwnerCurrent Issue Owner: @sakluger

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 25, 2024
  2. melvin-bot commented on Nov 25, 2024

    @melvin-bot

    Triggered auto assignment to @sakluger (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. MelvinBot commented on Nov 25, 2024

    @MelvinBot
    Contributor

    This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

  4. Shahidullah-Muffakir commented on Nov 26, 2024

    @Shahidullah-Muffakir
  5. cretadn22 commented on Nov 26, 2024

    @cretadn22
    Contributor

    Proposal

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

    When navigating to the Search page and searching for an expense associated with a pending Expensify Card transaction, the "Approve" button is incorrectly displayed for the pending transaction

    What is the root cause of that problem?

    In the condition for displaying the Approve button on the Search page, we have not included checks for pending card transactions.

    if (IOU.canApproveIOU(report, policy) && ReportUtils.isAllowedToApproveExpenseReport(report, undefined, policy)) {

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

    In here, We need to include conditions to check if all transactions are pending, similar to what we implemented here

        const transactions = TransactionUtils.getAllReportTransactions(report?.reportID);
        const hasOnlyPendingTransactions = transactions.length > 0 && transactions.every((t) => TransactionUtils.isExpensifyCardTransaction(t) && TransactionUtils.isPending(t));
        if (IOU.canApproveIOU(report, policy) && ReportUtils.isAllowedToApproveExpenseReport(report, undefined, policy) && !hasOnlyPendingTransactions) { 
    

    What alternative solutions did you explore? (Optional)

  6. melvin-bot commented on Nov 29, 2024

    @melvin-bot

    @sakluger Whoops! This issue is 2 days overdue. Let's get this updated quick!

  7. moved this to Bugs and Follow Up Issues in #expensify-bugson Dec 2, 2024
  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Dec 2, 2024
  9. melvin-bot commented on Dec 2, 2024

    @melvin-bot
  10. changed the title [-]'Approve' Button Incorrectly Displayed for Pending Expensify Card Transactions[/-] [+][$250] 'Approve' Button Incorrectly Displayed for Pending Expensify Card Transactions[/+] on Dec 2, 2024
  11. 39 remaining items

  12. changed the title [-][$250] 'Approve' Button Incorrectly Displayed for Pending Expensify Card Transactions[/-] [+][HOLD for payment 2024-12-30] [$250] 'Approve' Button Incorrectly Displayed for Pending Expensify Card Transactions[/+] on Dec 23, 2024
  13. melvin-bot commented on Dec 23, 2024

    @melvin-bot

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

  14. melvin-bot commented on Dec 23, 2024

    @melvin-bot

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

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

  15. melvin-bot commented on Dec 23, 2024

    @melvin-bot

    @jjcoffee @sakluger @jjcoffee 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]

  16. moved this from Bugs and Follow Up Issues to Hold for Payment in #expensify-bugson Dec 23, 2024
  17. sakluger commented on Dec 27, 2024

    @sakluger
    Contributor

    Hey @jjcoffee, could you please complete the BZ checklist before payment is due next Monday? Thanks!

  18. jjcoffee commented on Dec 30, 2024

    @jjcoffee
    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 (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: https://github.com/Expensify/App/pull/52441/files#r1899414978

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

    • Have an Expensify Card transaction in a pending state. This can be simulated on an existing transaction using:
    Onyx.merge('transactions_<TRANSACTIONID>', {bank: "Expensify Card", cardId: 4, status: "Pending"})
    Onyx.merge('snapshot_<SNAPSHOT_ID>', {data: {transactions_<TRANSACTIONID>: {bank: "Expensify Card", cardId: 4, status: "Pending"}}})

    (The SNAPSHOT_ID refers to the data the search results are based on).

    Test:

    1. Navigate to the Search page.
    2. Search for an expense associated with an Expensify Card transaction that is still in a pending state.
    3. Verify that there is no approve button next to the expense in the results.

    Do we agree 👍 or 👎

  19. sakluger commented on Dec 30, 2024

    @sakluger
    Contributor

    Summarizing payment on this issue:

    Contributor: @cretadn22 $250, paid via Upwork
    Contributor+: @jjcoffee $250, please request on Newdot

  20. moved this from Hold for Payment to Done in #expensify-bugson Dec 30, 2024
  21. garrettmknight commented on Jan 7, 2025

    @garrettmknight
    Contributor

    $250 approved for @jjcoffee

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 contributorNeeds ReproductionReproducible steps needed

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions