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 2023-10-13] [$500] The subtitle in LHN display wrong message when requesting message by scanning #27697

Closed
1 of 6 tasks
kavimuru opened this issue Sep 18, 2023 · 21 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

@kavimuru
Copy link

kavimuru commented Sep 18, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to any chat
  2. CLicking + button > Request Money > Scan
  3. Upload receipt and request
  4. See that in the LHN:
  • In chat (main chat) the message is ".... owes 0"
  • In the IOU chat the message is "Receipt scan in progress…"

Expected Result:

In chat (main chat) the message is "Receipt scan in progress…"

Actual Result:

In chat (main chat) the message is ".... owes 0"

  • In the IOU chat the message is "Receipt scan in progress…"

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 / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.71-5
Reproducible in staging?: y
Reproducible in production?: y
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
Notes/Photos/Videos: Any additional supporting documentation

Screenshot 2023-09-13 at 11 58 04

Recording.1592.mp4

Expensify/Expensify Issue URL:
Issue reported by: @DylanDylann
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694581294081939

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0154605d61aec2e78e
  • Upwork Job ID: 1703814551283154944
  • Last Price Increase: 2023-09-18
  • Automatic offers:
    • cubuspl42 | Reviewer | 26864976
    • DylanDylann | Contributor | 26864985
    • DylanDylann | Reporter | 26864992
@kavimuru kavimuru added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 18, 2023
@melvin-bot melvin-bot bot changed the title The subtitle in LHN display wrong message when requesting message by scanning [$500] The subtitle in LHN display wrong message when requesting message by scanning Sep 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

Triggered auto assignment to @anmurali (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

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

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

melvin-bot bot commented Sep 18, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

Triggered auto assignment to @sophiepintoraetz (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

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

@kavimuru
Copy link
Author

Proposal by @DylanDylann

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

The subtitle in LHN display wrong message when requesting message by scanning

What is the root cause of that problem?

App/src/libs/ReportUtils.js

Lines 1440 to 1446 in 60b8dae

if (shouldConsiderReceiptBeingScanned && ReportActionsUtils.isMoneyRequestAction(reportAction)) {
const linkedTransaction = TransactionUtils.getLinkedTransaction(reportAction);
if (!_.isEmpty(linkedTransaction) && TransactionUtils.hasReceipt(linkedTransaction) && TransactionUtils.isReceiptBeingScanned(linkedTransaction)) {
return Localize.translateLocal('iou.receiptScanning');
}
}

Let’s see here, we only check isMoneyRequestAction, not check isReportPreviewAction. Not that, isMoneyRequestAction only be true if this reportAction is in the IOU chat. In case, the report action is in the main chat the type is REPORTPREVIEW

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

In this function

function getReportPreviewMessage(report, reportAction = {}, shouldConsiderReceiptBeingScanned = false) {

We should add the condition and return Localize.translateLocal(‘iou.receiptScanning’) for REPORTPREVIEW like we did for
isReportPreviewAction

if (shouldConsiderReceiptBeingScanned && ReportActionsUtils.isReportPreviewAction(reportAction)) {
        const linkedTransaction = TransactionUtils.getTransaction(reportAction.childLastReceiptTransactionIDs);
        if (!_.isEmpty(linkedTransaction) && TransactionUtils.hasReceipt(linkedTransaction) && TransactionUtils.isReceiptBeingScanned(linkedTransaction)) {
            return Localize.translateLocal(‘iou.receiptScanning’);
        }
    }

We can create a function to dry code
And in here

lastMessageTextFromReport = ReportUtils.getReportPreviewMessage(iouReport, lastReportAction);

we need to pass shouldConsiderReceiptBeingScanned is true in the third param

Result

<img width=“1440” alt=“Screenshot 2023-09-18 at 16 26 33" src=“https://github.com/Expensify/App/assets/141406735/a7d44705-0466-458d-b6d2-d4c83aa81285”>

@DylanDylann
Copy link
Contributor

Re-post proposal with a bit change

Proposal

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

The subtitle in LHN display wrong message when requesting message by scanning

What is the root cause of that problem?

App/src/libs/ReportUtils.js

Lines 1440 to 1446 in 60b8dae

if (shouldConsiderReceiptBeingScanned && ReportActionsUtils.isMoneyRequestAction(reportAction)) {
const linkedTransaction = TransactionUtils.getLinkedTransaction(reportAction);
if (!_.isEmpty(linkedTransaction) && TransactionUtils.hasReceipt(linkedTransaction) && TransactionUtils.isReceiptBeingScanned(linkedTransaction)) {
return Localize.translateLocal('iou.receiptScanning');
}
}

Let’s see here, we only check isMoneyRequestAction, not check isReportPreviewAction. Note that isMoneyRequestAction only be true if this reportAction is in the IOU chat. In case, the report action is in the main chat the type is REPORTPREVIEW

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

In this function

function getReportPreviewMessage(report, reportAction = {}, shouldConsiderReceiptBeingScanned = false) {

We should add the condition and return Localize.translateLocal(‘iou.receiptScanning’) for REPORTPREVIEW like we did for
isReportPreviewAction

if (shouldConsiderReceiptBeingScanned && ReportActionsUtils.isReportPreviewAction(reportAction)) {
        const linkedTransaction = TransactionUtils.getTransaction(reportAction.childLastReceiptTransactionIDs);
        if (!_.isEmpty(linkedTransaction) && TransactionUtils.hasReceipt(linkedTransaction) && TransactionUtils.isReceiptBeingScanned(linkedTransaction)) {
            return Localize.translateLocal(‘iou.receiptScanning’);
        }
    }

We can create a function to dry code
And then in here

lastMessageTextFromReport = ReportUtils.getReportPreviewMessage(iouReport, lastReportAction);

we need to pass shouldConsiderReceiptBeingScanned is true in the third param

Result

Screenshot 2023-09-19 at 00 29 01

@melvin-bot melvin-bot bot added the Overdue label Sep 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

@cubuspl42, @anmurali, @sophiepintoraetz Whoops! This issue is 2 days overdue. Let's get this updated quick!

@cubuspl42
Copy link
Contributor

The proposal by @DylanDylann sounds reasonable. I agree that there might be potential for refactoring the shared logic in a helper function, we'll focus on that when working on the PR.

C+ reviewed 🎀 👀 🎀

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Triggered auto assignment to @tylerkaraszewski, 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 Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

📣 @cubuspl42 🎉 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

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

📣 @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
Copy link

melvin-bot bot commented Sep 25, 2023

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

Offer link
Upwork job

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 26, 2023
@DylanDylann
Copy link
Contributor

@cubuspl42 Could you help review this PR?

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @DylanDylann got assigned: 2023-09-25 18:24:13 Z
  • when the PR got merged: 2023-10-04 17:00:29 UTC
  • days elapsed: 6

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 6, 2023
@melvin-bot melvin-bot bot changed the title [$500] The subtitle in LHN display wrong message when requesting message by scanning [HOLD for payment 2023-10-13] [$500] The subtitle in LHN display wrong message when requesting message by scanning Oct 6, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.78-4 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 2023-10-13. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

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:

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

@cubuspl42 cubuspl42 mentioned this issue Oct 6, 2023
59 tasks
@cubuspl42
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR:
  • 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:
  • 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 for additional discussion
  • Determine if we should create a regression test for this bug.
    • Up to the QA team
  • 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.
    • Navigate to any chat
    • Select the '+' button, then choose 'Request Money', followed by 'Scan'
    • Upload the desired receipt and submit request
    • In the Left Hand Navigation (LHN), confirm that the displayed message reads "Receipt scan in progress…"

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

@tylerkaraszewski, @cubuspl42, @anmurali, @sophiepintoraetz, @DylanDylann Eep! 4 days overdue now. Issues have feelings too...

@sophiepintoraetz
Copy link
Contributor

I also think this was eligible for the urgency bonus, given the merging delay was on our end.

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

6 participants