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

[WAITING ON CHECKLIST] [$250] Expense Details - The header of the expense details displays "[amount] for [Description]" #49993

Closed
1 of 6 tasks
lanitochka17 opened this issue Oct 1, 2024 · 25 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 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

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 1, 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.42-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5023024
Email or phone of affected tester (no customers): biruknew45+1278@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Create a workspace
  3. Go to the workspace chat
  4. Click the plus button > Submit Expense > enter amount, description, and merchant, and complete the submission
  5. Open the expense details

Expected Result:

The conversation title in the LHN should display "[amount] for [Merchant]"

Actual Result:

The conversation title in the LHN displays "[amount] for [Description]"

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

Bug6620960_1727776903763.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021841274388644598293
  • Upwork Job ID: 1841274388644598293
  • Last Price Increase: 2024-10-02
Issue OwnerCurrent Issue Owner: @
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 1, 2024
Copy link

melvin-bot bot commented Oct 1, 2024

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.

@lanitochka17
Copy link
Author

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

@nkdengineer
Copy link
Contributor

nkdengineer commented Oct 1, 2024

Proposal

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

What is the root cause of that problem?

We pass the comment as description here then LHN displays amount for description

let comment = !isEmptyObject(linkedTransaction) ? TransactionUtils.getDescription(linkedTransaction) : undefined;

return `${requestorName ? `${requestorName}: ` : ''}${Localize.translateLocal('iou.submittedAmount', {formattedAmount: amountToDisplay, comment})}`;

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

Here we should get the merchant first then fallback to description if the merchant is empty

let comment = !isEmptyObject(linkedTransaction) ? TransactionUtils.getMerchant(linkedTransaction) || TransactionUtils.getDescription(linkedTransaction) : undefined; 

let comment = !isEmptyObject(linkedTransaction) ? TransactionUtils.getDescription(linkedTransaction) : undefined;

OPTIONAL: we can also do the same here

What alternative solutions did you explore? (Optional)

@bernhardoj
Copy link
Contributor

bernhardoj commented Oct 1, 2024

Proposal

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

The last message when we submit an expense with a merchant and description will show the description instead of the merchant.

What is the root cause of that problem?

We always use the description here.

let comment = !isEmptyObject(linkedTransaction) ? TransactionUtils.getDescription(linkedTransaction) : undefined;

return `${requestorName ? `${requestorName}: ` : ''}${Localize.translateLocal('iou.submittedAmount', {formattedAmount: amountToDisplay, comment})}`;

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

We need to follow the same logic from getTransactionReportName which checks whether the merchant is empty or not before using it because (none) merchant is also empty.

const comment = (!TransactionUtils.isMerchantMissing(transaction) ? TransactionUtils.getMerchant(transaction) : TransactionUtils.getDescription(transaction)) ?? '';

let comment = !isEmptyObject(linkedTransaction) ? (!TransactionUtils.isMerchantMissing(linkedTransaction) ? TransactionUtils.getMerchant(linkedTransaction) : TransactionUtils.getDescription(linkedTransaction)) : undefined;

We can apply the same fix here

return Localize.translateLocal('iou.didSplitAmount', {formattedAmount, comment: TransactionUtils.getDescription(linkedTransaction) ?? ''});

return Localize.translateLocal('iou.trackedAmount', {formattedAmount, comment: TransactionUtils.getDescription(linkedTransaction) ?? ''});

comment: TransactionUtils.getDescription(transaction) ?? '',

NOTE: I think we can create a getMerchantOrDescription so the logic is reusable.

@jliexpensify
Copy link
Contributor

I can repro but not sure if we made this change intentionally, so asking here: https://expensify.slack.com/archives/C036QM0SLJK/p1727826242838209

@jliexpensify jliexpensify changed the title Expense Details - The header of the expense details displays "[amount] for [Description]" [WAITING ON SLACK] Expense Details - The header of the expense details displays "[amount] for [Description]" Oct 1, 2024
@jliexpensify jliexpensify changed the title [WAITING ON SLACK] Expense Details - The header of the expense details displays "[amount] for [Description]" Expense Details - The header of the expense details displays "[amount] for [Description]" Oct 2, 2024
@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label Oct 2, 2024
Copy link

melvin-bot bot commented Oct 2, 2024

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

@melvin-bot melvin-bot bot changed the title Expense Details - The header of the expense details displays "[amount] for [Description]" [$250] Expense Details - The header of the expense details displays "[amount] for [Description]" Oct 2, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 2, 2024
Copy link

melvin-bot bot commented Oct 2, 2024

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

@jliexpensify
Copy link
Contributor

Confirmed that this seems to be a bug:

merchant should take priority over description like the preview component

@jliexpensify
Copy link
Contributor

@alitoshmatov I'm OOO from 3rd to 14th, but I don't think anything is needed from me during this period. Feel free to reassign to another B0 if urgent payment is needed, otherwise I'll catch up on this issue when I get back!

@alitoshmatov
Copy link
Contributor

@nkdengineer @bernhardoj Thank you both for proposals. Your RCA is correct and you provide with almost the same solution.

It is hard choice to make since both proposals are very similar solution, even though @bernhardoj was the second one to submit he did have small additional changes.

I think we should go with @bernhardoj's proposal since it has additional changes that we might have missed it

C+ reviewed 🎀 👀 🎀

Copy link

melvin-bot bot commented Oct 6, 2024

Triggered auto assignment to @yuwenmemon, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 7, 2024
Copy link

melvin-bot bot commented Oct 7, 2024

❌ There was an error making the offer to @alitoshmatov for the Reviewer role. The BZ member will need to manually hire the contributor.

@bernhardoj
Copy link
Contributor

PR is ready

cc: @alitoshmatov

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Oct 15, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Oct 15, 2024
@melvin-bot melvin-bot bot changed the title [$250] Expense Details - The header of the expense details displays "[amount] for [Description]" [HOLD for payment 2024-10-22] [$250] Expense Details - The header of the expense details displays "[amount] for [Description]" Oct 15, 2024
Copy link

melvin-bot bot commented Oct 15, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 15, 2024
Copy link

melvin-bot bot commented Oct 15, 2024

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

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

  • @bernhardoj requires payment through NewDot Manual Requests
  • @alitoshmatov requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Oct 15, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@alitoshmatov] The PR that introduced the bug has been identified. Link to the PR:
  • [@alitoshmatov] 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:
  • [@alitoshmatov] A discussion in #expensify-bugs 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:
  • [@alitoshmatov] Determine if we should create a regression test for this bug.
  • [@alitoshmatov] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@jliexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 21, 2024
@jliexpensify
Copy link
Contributor

jliexpensify commented Oct 22, 2024

Payment Summary

@bernhardoj
Copy link
Contributor

Requested in ND.

Copy link

melvin-bot bot commented Oct 22, 2024

Payment Summary

Upwork Job

BugZero Checklist (@jliexpensify)

  • 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/1841274388644598293/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@jliexpensify jliexpensify added External Added to denote the issue can be worked on by a contributor and removed External Added to denote the issue can be worked on by a contributor labels Oct 22, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 22, 2024
Copy link

melvin-bot bot commented Oct 22, 2024

Current assignee @alitoshmatov is eligible for the External assigner, not assigning anyone new.

@jliexpensify
Copy link
Contributor

Sorry, upworks is being really weird and won't let me access the job so I closed it and am trying to see if another Job is created.

@jliexpensify
Copy link
Contributor

@alitoshmatov waiting on checklist, and invited you to a new job here:

https://www.upwork.com/jobs/~021848861002130198557

@jliexpensify
Copy link
Contributor

Paid @alitoshmatov via Upworks, just waiting on checklist

@jliexpensify jliexpensify removed the Awaiting Payment Auto-added when associated PR is deployed to production label Oct 23, 2024
@jliexpensify jliexpensify changed the title [HOLD for payment 2024-10-22] [$250] Expense Details - The header of the expense details displays "[amount] for [Description]" [WAITING ON CHECKLIST] [$250] Expense Details - The header of the expense details displays "[amount] for [Description]" Oct 23, 2024
@alitoshmatov alitoshmatov mentioned this issue Oct 23, 2024
49 tasks
@alitoshmatov
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Track Expense flow #37282
  • 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/37282/files#r1812400386
  • A discussion in #expensify-bugs 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: No need
  • Determine if we should create a regression test for this bug. No need

@JmillsExpensify
Copy link

$250 approved for @bernhardoj based on this summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 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
Projects
None yet
Development

No branches or pull requests

7 participants