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] Android - QAB - In mWeb, merchant shown as "expense"&in Android unexpected error for QAB expense #48238

Closed
2 of 6 tasks
IuliiaHerets opened this issue Aug 29, 2024 · 19 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Aug 29, 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?: 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/4898411
Issue reported by: Applause Internal Team

Action Performed:

  1. Launch site in both mweb and Android app
  2. Tap fab -- submit an expense
  3. Tap tab -- via QAB submit an expense
  4. In mweb, open both expense and for Android wait few seconds

Expected Result:

With any inconsistency and error user must be able to submit expense via QAB.

Actual Result:

In mweb, merchant shown as "expense" in QAB via createe expense. In Android, QAB via created expense shows unexpected error.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6585120_1724841105617.sub.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01095a4da6e8b969c0
  • Upwork Job ID: 1830537395505788792
  • Last Price Increase: 2024-09-02
  • Automatic offers:
    • nkdengineer | Contributor | 103901378
Issue OwnerCurrent Issue Owner: @rushatgabhane
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 29, 2024
Copy link

melvin-bot bot commented Aug 29, 2024

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

@IuliiaHerets
Copy link
Author

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

@CyberAndrii
Copy link
Contributor

Proposal

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

Merchant is shown as "Expense" if the expense was created via the "Quick action" button

image

What is the root cause of that problem?

Expense created via FAB > Submit expense has the merchant property set to CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT.

Expense created via FAB > Quick action > Submit expense has the merchant property set to CONST.TRANSACTION.DEFAULT_MERCHANT.

Then in MoneyRequestView we decide whether the merchant name should be shown

const isEmptyMerchant = transactionMerchant === '' || transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;

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

We need to add a check for CONST.TRANSACTION.DEFAULT_MERCHANT similar to how it's done in other places

diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx
index 57c5c01da55..d2860bbd0fb 100644
--- a/src/components/ReportActionItem/MoneyRequestView.tsx
+++ b/src/components/ReportActionItem/MoneyRequestView.tsx
@@ -163,7 +163,10 @@ function MoneyRequestView({
         originalAmount: transactionOriginalAmount,
         originalCurrency: transactionOriginalCurrency,
     } = useMemo<Partial<TransactionDetails>>(() => ReportUtils.getTransactionDetails(transaction) ?? {}, [transaction]);
-    const isEmptyMerchant = transactionMerchant === '' || transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;
+    const isEmptyMerchant =
+        transactionMerchant === '' ||
+        transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT ||
+        transactionMerchant === CONST.TRANSACTION.DEFAULT_MERCHANT;
     const isDistanceRequest = TransactionUtils.isDistanceRequest(transaction);
     const formattedTransactionAmount = transactionAmount ? CurrencyUtils.convertToDisplayString(transactionAmount, transactionCurrency) : '';
     const formattedOriginalAmount = transactionOriginalAmount && transactionOriginalCurrency && CurrencyUtils.convertToDisplayString(transactionOriginalAmount, transactionOriginalCurrency);

@melvin-bot melvin-bot bot added the Overdue label Sep 2, 2024
@CyberAndrii
Copy link
Contributor

My proposal doesn't cover the error on android part as it is being fixed in #45086

@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label Sep 2, 2024
@melvin-bot melvin-bot bot changed the title Android - QAB - In mWeb, merchant shown as "expense"&in Android unexpected error for QAB expense [$250] Android - QAB - In mWeb, merchant shown as "expense"&in Android unexpected error for QAB expense Sep 2, 2024
Copy link

melvin-bot bot commented Sep 2, 2024

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

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

melvin-bot bot commented Sep 2, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Sep 2, 2024
@nkdengineer
Copy link
Contributor

Proposal

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

In mweb, merchant shown as "expense" in QAB via createe expense. In Android, QAB via created expense shows unexpected error.

What is the root cause of that problem?

  • If we create a transaction with merchant is (none), BE returns it as (none).
  • If we create a transaction with the merchant as an empty string, it's expected that BE returns it as Expense

The problem here is, that when we create a money request via QAB we pass the merchant as empty string here and here but we pass it as (none) here and when we init the money request we also pass it as (none) here

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

We should pass the merchant as CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT here and here by default as we do in other places. We also need to fix other QAB case that has a similar bug in IOURequestStepScan and IOURequestStepDistance

OPTIONAL: We can also add the check here to return true if the merchant is Expense.

const isEmptyMerchant = transactionMerchant === '' || transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;

What alternative solutions did you explore? (Optional)

@rushatgabhane
Copy link
Member

@CyberAndrii 's proposal LGTM because first

🎀 👀 🎀

Copy link

melvin-bot bot commented Sep 4, 2024

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

@nkdengineer
Copy link
Contributor

@rushatgabhane Can you please check again, for consistent I think we should pass merchant as CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT when we create the money request via QAB.

@aldo-expensify
Copy link
Contributor

Waiting on @rushatgabhane to check the comment above before assigning

@rushatgabhane
Copy link
Member

rushatgabhane commented Sep 9, 2024

If we create a transaction with merchant is (none), BE returns it as (none).
If we create a transaction with the merchant as an empty string, it's expected that BE returns it as Expense

What @nkdengineer said here also makes sense and it feels closer to the root cause. @aldo-expensify we can assign @nkdengineer. What do you think?

@aldo-expensify
Copy link
Contributor

What @nkdengineer said here also makes sense and it feels closer to the root cause. @aldo-expensify we can assign @nkdengineer.

After reading both proposals, I agree with you. Assigning @nkdengineer .

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Sep 10, 2024

noooooo

I clicked that X Clear assignees and I removed everyone 🤦
image

I hope the automation doesn't break 😬

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

melvin-bot bot commented Sep 10, 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 Sep 11, 2024
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Oct 4, 2024
Copy link

melvin-bot bot commented Oct 4, 2024

This issue has not been updated in over 15 days. @twisterdotcom, @rushatgabhane, @aldo-expensify, @nkdengineer eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@nkdengineer
Copy link
Contributor

@twisterdotcom The PR was deployed to production. This is ready for payment.

@twisterdotcom
Copy link
Contributor

Payment Summary:

@garrettmknight
Copy link
Contributor

$250 approved for @rushatgabhane

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. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review
Projects
No open projects
Status: Done
Development

No branches or pull requests

7 participants