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

[$250] Expense - Banner shows "transaction pending" when there is no pending Ecard transaction #48083

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 27, 2024 · 16 comments
Closed
1 of 6 tasks
Assignees
Labels
Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Hourly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 27, 2024

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.25
Reproducible in staging?: Y
Reproducible in production?: N
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+kh2508001@applause.expensifail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to https://staging.chat.expensify.com
  2. Go to workspace chat
  3. Submit a manual expense
  4. Click on the expense preview

Expected Result:

The banner will not show "Transaction pending. It may take a few days to post." because there is no pending Ecard transaction

Actual Result:

The banner shows "Transaction pending. It may take a few days to post."

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence

20240827_131711.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01dfc30aa1d4201062
  • Upwork Job ID: 1828526591139483595
  • Last Price Increase: 2024-08-27
  • Automatic offers:
    • rojiphil | Reviewer | 103709050
    • Nodebrute | Contributor | 103709053
Issue OwnerCurrent Issue Owner: @rojiphil
@lanitochka17 lanitochka17 added the DeployBlocker Indicates it should block deploying the API label Aug 27, 2024
@melvin-bot melvin-bot bot added the Daily KSv2 label Aug 27, 2024
@Nodebrute
Copy link
Contributor

Nodebrute commented Aug 27, 2024

Edited by proposal-police: This proposal was edited at 2024-08-27 13:34:39 UTC.

Proposal

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

Banner shows "transaction pending" when there is no pending Ecard transaction

What is the root cause of that problem?

ReportUtils.getTransactionsWithReceipts returns an empty array, which causes this to be true.

const hasOnlyPendingTransactions = ReportUtils.getTransactionsWithReceipts(moneyRequestReport?.reportID).every(

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

First, we need to check if ReportUtils.getTransactionsWithReceipts(moneyRequestReport?.reportID) returns a non-empty array. Only if it's not empty then we should use every method on it. If the array is empty, we should return false.

const hasOnlyPendingTransactions = ReportUtils.getTransactionsWithReceipts(moneyRequestReport?.reportID).every(

We can create a utility function to check if hasTransactionsWithReceipts if it returns true only then we should use ReportUtils.getTransactionsWithReceipts(moneyRequestReport?.reportID).

We have two options here: either make changes directly in getTransactionsWithReceipts or update all the places where this function is used.

We are doing the same here where we have two functions

App/src/libs/actions/IOU.ts

Lines 6997 to 6998 in 492b884

if (full && hasHeldExpenses) {
const heldTransactions = ReportUtils.getAllHeldTransactions(expenseReport?.reportID);

If this issue appears elsewhere, we should fix it there as well

What alternative solutions did you explore? (Optional)

@Nodebrute
Copy link
Contributor

@lanitochka17 Could you add the labels again? no one is assigned here.

@lanitochka17 lanitochka17 added DeployBlocker Indicates it should block deploying the API DeployBlockerCash This issue or pull request should block deployment and removed Daily KSv2 DeployBlocker Indicates it should block deploying the API labels Aug 27, 2024
Copy link

melvin-bot bot commented Aug 27, 2024

Triggered auto assignment to @luacmartins (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@luacmartins luacmartins added the External Added to denote the issue can be worked on by a contributor label Aug 27, 2024
@melvin-bot melvin-bot bot changed the title Expense - Banner shows "transaction pending" when there is no pending Ecard transaction [$250] Expense - Banner shows "transaction pending" when there is no pending Ecard transaction Aug 27, 2024
Copy link

melvin-bot bot commented Aug 27, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01dfc30aa1d4201062

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 27, 2024
Copy link

melvin-bot bot commented Aug 27, 2024

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

@luacmartins
Copy link
Contributor

Likely a regression from #47821 cc @grgia @dangrous

@luacmartins
Copy link
Contributor

@Nodebrute are you available to work on a fix?

@Nodebrute
Copy link
Contributor

@luacmartins Yes, I can raise a pr right now.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 27, 2024
@luacmartins luacmartins added Help Wanted Apply this label when an issue is open to proposals by contributors and removed DeployBlocker Indicates it should block deploying the API labels Aug 27, 2024
Copy link

melvin-bot bot commented Aug 27, 2024

📣 @rojiphil 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Aug 27, 2024

📣 @Nodebrute 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@luacmartins
Copy link
Contributor

Cool, all yours then

@Nodebrute
Copy link
Contributor

The PR will be done in about 30 minutes.

@dangrous
Copy link
Contributor

oh i think we already have a fix for this maybe? #47941

We noticed this last week but hasn't been fully reviewed yet

@luacmartins
Copy link
Contributor

@Nodebrute please hold on working on the PR as it seems like we already had a fix in place - #47941

@luacmartins
Copy link
Contributor

This is fixed in staging. Closing.

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Hourly KSv2
Projects
None yet
Development

No branches or pull requests

5 participants