Skip to content

[HOLD for payment 2023-11-13] [$500] IOU - Copy to clipboard paid IOU in IOU page, instead of paid text requested text shown #29878

Closed

Description

@lanitochka17

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.3.86-1

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Tap on a Workspace chat
  3. Tap plus icon near compose
  4. Tap request money--manual
  5. Enter an amount
  6. Tap request amount
  7. Tap on IOU and Pay elsewhere
  8. Tap on paid IOU to open IOU page
  9. On IOU page, long press the IOU paid
  10. Select copy to clipboard
  11. Paste on compose box

Expected Result:

When user copy to clipboard paid IOU in IOU page, paid "Brand new paid $0.04 elsewhere" text must be shown

Actual Result:

When user copy to clipboard paid IOU in IOU page, instead of this paid "Brand new paid $0.04 elsewhere" text requested text "requested ₹3.00" is shown

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

Android: Native
Android: mWeb Chrome
Bug6241908_1697642942787.clip.mp4
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ee91e1d5782ad7bf
  • Upwork Job ID: 1715472695797161984
  • Last Price Increase: 2023-10-20

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 18, 2023
  2. melvin-bot commented on Oct 18, 2023

    @melvin-bot

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

  3. melvin-bot commented on Oct 18, 2023

    @melvin-bot

    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
  4. dukenv0307 commented on Oct 19, 2023

    @dukenv0307
    Contributor

    Proposal

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

    Copy to clipboard paid IOU in IOU page, instead of paid text requested text shown

    What is the root cause of that problem?

    if originalMessage of MoneyRequestAction has type isn't pay, we always return iou.requestedAmount without checking it's paid or not

    App/src/libs/ReportUtils.js

    Lines 3911 to 3915 in 229cb5d

    const transaction = TransactionUtils.getTransaction(originalMessage.IOUTransactionID);
    const {amount, currency, comment} = getTransactionDetails(transaction);
    const formattedAmount = CurrencyUtils.convertToDisplayString(amount, currency);
    displayMessage = Localize.translateLocal('iou.requestedAmount', {
    formattedAmount,

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

    For this case we should check if the request is paid or not we will return the display message accordingly

    const isRequestSettled = isSettled(originalMessage.IOUReportID);
    if (!isRequestSettled) {
        displayMessage = Localize.translateLocal('iou.requestedAmount', {
            formattedAmount,
            comment,
        });
    } else {
        displayMessage = Localize.translateLocal('iou.payerSettled', {
            amount: formattedAmount
        });
    }
    

    For the case the request is paid, we can create a new translation key to display more information about the request i.e. comment, ...

    App/src/libs/ReportUtils.js

    Lines 3911 to 3915 in 229cb5d

    const transaction = TransactionUtils.getTransaction(originalMessage.IOUTransactionID);
    const {amount, currency, comment} = getTransactionDetails(transaction);
    const formattedAmount = CurrencyUtils.convertToDisplayString(amount, currency);
    displayMessage = Localize.translateLocal('iou.requestedAmount', {
    formattedAmount,

    What alternative solutions did you explore? (Optional)

  5. Nathan-Mulugeta commented on Oct 19, 2023

    @Nathan-Mulugeta

    Proposal

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

    "Request" message is being shown instead of "paid" message when copying from the iou preview component.

    What is the root cause of that problem?

    The root cause of this issue is here:

    const reportAction = useMemo(() => {
    if (_.isEmpty(props.reportActions) || props.reportActionID === '0') {
    return {};
    }
    return props.reportActions[props.reportActionID] || {};
    }, [props.reportActions, props.reportActionID]);

    reportAction is not up to date and is not getting the latest reportAction instead is reading the previous reportAction.
    We can see the current latest report action contains the correct originalMessage type hence gets the correct message.

    image

    Things work perfectly fine for ReportActionItem because it is getting the current correct prop.

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

    I just identified the root cause and wanted to bring forth my discoveries for what its worth. Still didn't know why it is not getting the latest reportAction props.

    What alternative solutions did you explore? (Optional)

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 20, 2023
  7. changed the title [-]IOU - Copy to clipboard paid IOU in IOU page, instead of paid text requested text shown[/-] [+][$500] IOU - Copy to clipboard paid IOU in IOU page, instead of paid text requested text shown[/+] on Oct 20, 2023
  8. melvin-bot commented on Oct 20, 2023

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 20, 2023
  10. melvin-bot commented on Oct 20, 2023

    @melvin-bot

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

  11. 18 remaining items

  12. melvin-bot commented on Nov 6, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.95-9 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-11-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:

  13. melvin-bot commented on Nov 6, 2023

    @melvin-bot

    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:

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

    @MitchExpensify
    Contributor

    Payment summary:

    $500 @Ollyws requires payment
    $500 @dukenv0307 requires payment

  15. MitchExpensify commented on Nov 14, 2023

    @MitchExpensify
    Contributor

    Invited you both to the Upwork, job @dukenv0307 @Ollyws - Lemme know when you accept to issue payment 🙇

  16. dukenv0307 commented on Nov 15, 2023

    @dukenv0307
    Contributor

    @MitchExpensify accepted, thank you!

  17. Ollyws commented on Nov 15, 2023

    @Ollyws
    Contributor

    BugZero Checklist:

    • The PR that introduced the bug has been identified. Link to the PR:

    I don't think we can really call this a regression from any PR as the we never had copy functionality for the IOU preview before #24630 was implemented, which unearthed this issue.

    • 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:

    N/A

    • 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:

    N/A

    • Determine if we should create a regression test for this bug.

    I don't think a regression test would be helpful for this one as it's not very impactful nor does it affect the flow in any significant way.

  18. MitchExpensify commented on Nov 16, 2023

    @MitchExpensify
    Contributor

    Paid and contracts ended, thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions