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

[HOLD for payment 2024-06-06] [$250] Pay-On pay money, description in preview changed to expense after few seconds #40585

Closed
4 of 6 tasks
izarutskaya opened this issue Apr 19, 2024 · 40 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Apr 19, 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: 1.4.63-0
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Go to https://staging.new.expensify.com/home

  2. Tap on a report

  3. Enter an amount and tap next

  4. Enter description

  5. Tap pay elsewhere

  6. Note IOU preview details

Expected Result:

When we pay money, description or merchant must be displayed without getting altered.

Actual Result:

When we pay money, description is shown in preview and after few seconds it is changed to "expense"(merchant)

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

Bug6453941_1713460523330.govinda.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018753cc78d651b6ba
  • Upwork Job ID: 1785065405571158016
  • Last Price Increase: 2024-05-07
  • Automatic offers:
    • nkdengineer | Contributor | 0
    • DylanDylann | Contributor | 0
Issue OwnerCurrent Issue Owner: @kevinksullivan
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 19, 2024
Copy link

melvin-bot bot commented Apr 19, 2024

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

@izarutskaya
Copy link
Author

We think this issue might be related to the #vip-vsb.

@FitseTLT
Copy link
Contributor

BE is setting the merchant to Expense for pay request type we can align it in optimistic data to align to it but I think the BE should return none same as submitting request when merchant is not set.

@ShridharGoel
Copy link
Contributor

Proposal

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

On using pay someone option, merchant set by backend shows instead of description.

What is the root cause of that problem?

In ReportPreview, if formattedMerchant is available, then it is being shown. In this case, we are getting the merchant as "Expense" from the backend.

if (formattedMerchant) {
    return {isSupportTextHtml: false, supportText: formattedMerchant};
}

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

Put a check on either the merchant name or the report type.

If merchant name is "Expense", we can show the description instead since the merchant name is not relevant here.

if (formattedMerchant && formattedMerchant != "Expense") { // Move "Expense" to CONST.ts
    return {isSupportTextHtml: false, supportText: formattedMerchant};
}
if (formattedDescription ?? moneyRequestComment) {
    const parsedSubtitle = new ExpensiMark().replace(formattedDescription ?? moneyRequestComment);
    return {isSupportTextHtml: !!parsedSubtitle, supportText: parsedSubtitle ? `<muted-text>${parsedSubtitle}</muted-text>` : ''};
}

Else we can also put check on the type (send money/pay someone).

@melvin-bot melvin-bot bot added the Overdue label Apr 22, 2024
@bernhardoj
Copy link
Contributor

Proposal

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

The send money request shows merchant as Expense after a few seconds.

What is the root cause of that problem?

When we create a new send money request, we always set the merchant to "(none)" since the user isn't allowed to set a merchant for sending money. After the request is completed, BE returns the merchant as "Expense".

This confuses the user because of the value inconsistency between FE and BE. It could be a BE issue, but maybe we intentionally change it since the user is not allowed to set a merchant for a send request.

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

Set the merchant value for send money optimistically to "Expense".

const optimisticTransaction = TransactionUtils.buildOptimisticTransaction(amount, currency, optimisticIOUReport.reportID, comment);

const optimisticTransaction = TransactionUtils.buildOptimisticTransaction(amount, currency, optimisticIOUReport.reportID, comment, undefined, undefined, undefined, 'Expense');

@dragnoir
Copy link
Contributor

BE issue. When Merchant is not set and Description is set, the backend should turn "merchant": "(none)" and not:

image

Copy link

melvin-bot bot commented Apr 22, 2024

@kevinksullivan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented Apr 24, 2024

@kevinksullivan Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Apr 26, 2024

@kevinksullivan 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@kevinksullivan
Copy link
Contributor

Adding to vip-split.

@kevinksullivan kevinksullivan 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 Apr 29, 2024
@melvin-bot melvin-bot bot removed the Overdue label Apr 29, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

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

@melvin-bot melvin-bot bot changed the title Pay-On pay money, description in preview changed to expense after few seconds [$250] Pay-On pay money, description in preview changed to expense after few seconds Apr 29, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 29, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

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

@kevinksullivan kevinksullivan added the External Added to denote the issue can be worked on by a contributor label Apr 29, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

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

@DylanDylann
Copy link
Contributor

Taking over as C+

@ntdiary ntdiary removed their assignment Apr 30, 2024
@DylanDylann
Copy link
Contributor

First of all, we need to clarify the expectations for this case. When creating a new send money request, should we add the default merchant as "Expense"?

@shawnborton Could you help to give a thought from the UX perspective ?

🎀👀🎀 C+ reviewed

Also want to hear an option from the internal engineer

Copy link

melvin-bot bot commented May 2, 2024

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

@shawnborton
Copy link
Contributor

Hmm yeah, I would think we should use the description in this case and not the backup merchant text of "Expense" - flagging this one for @trjExpensify and @JmillsExpensify - do you have any context here?

But yeah, agree this is a bug, I wouldn't expect the description to change to "Expense" in this flow.

@DylanDylann
Copy link
Contributor

As for this requirement, @nkdengineer's proposal looks good. Let's go with them

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented May 9, 2024

Current assignee @mountiny is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

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

melvin-bot bot commented May 9, 2024

📣 @nkdengineer 🎉 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 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels May 10, 2024
Copy link

melvin-bot bot commented May 10, 2024

📣 @DylanDylann 🎉 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 📖

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 30, 2024
@melvin-bot melvin-bot bot changed the title [$250] Pay-On pay money, description in preview changed to expense after few seconds [HOLD for payment 2024-06-06] [$250] Pay-On pay money, description in preview changed to expense after few seconds May 30, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 30, 2024
Copy link

melvin-bot bot commented May 30, 2024

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

Copy link

melvin-bot bot commented May 30, 2024

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

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

Copy link

melvin-bot bot commented May 30, 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:

  • [@DylanDylann] The PR that introduced the bug has been identified. Link to the PR:
  • [@DylanDylann] 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:
  • [@DylanDylann] 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:
  • [@DylanDylann] Determine if we should create a regression test for this bug.
  • [@DylanDylann] 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.
  • [@kevinksullivan] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@DylanDylann
Copy link
Contributor

DylanDylann commented Jun 5, 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:

[@DylanDylann] The PR that introduced the bug has been identified. Link to the PR: This caused by BE changes
[@DylanDylann] 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: NA
[@DylanDylann] 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: NA
[@DylanDylann] Determine if we should create a regression test for this bug. Yes
[@DylanDylann] 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.

Regression Test Proposal

  1. Click on FAB button
  2. Click on Pay Someone
  3. Enter amount
  4. Go to confirmation page
  5. Enter description
  6. Click "Pay Somewhere"
  7. See that the description still remains and has not been changed

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jun 6, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

@kevinksullivan, @mountiny, @DylanDylann, @nkdengineer Eep! 4 days overdue now. Issues have feelings too...

@kevinksullivan
Copy link
Contributor

Regression test created and payments made in upwork. All set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests