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-11-13] [$500] IOU - Copy to clipboard paid IOU in IOU page, instead of paid text requested text shown #29878

Closed
3 of 6 tasks
lanitochka17 opened this issue Oct 18, 2023 · 19 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

@lanitochka17
Copy link

lanitochka17 commented Oct 18, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 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

@dukenv0307
Copy link
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)

@Nathan-Mulugeta
Copy link

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)

@melvin-bot melvin-bot bot added the Overdue label Oct 20, 2023
@MitchExpensify MitchExpensify added the External Added to denote the issue can be worked on by a contributor label Oct 20, 2023
@melvin-bot melvin-bot bot 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 Oct 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

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

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

melvin-bot bot commented Oct 20, 2023

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

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 20, 2023
@Ollyws
Copy link
Contributor

Ollyws commented Oct 24, 2023

Will get to this one asap.

@melvin-bot melvin-bot bot removed the Overdue label Oct 24, 2023
@Ollyws
Copy link
Contributor

Ollyws commented Oct 26, 2023

It looks like we're just using the requested message here regardless of if the request is settled or not, so @dukenv0307's proposal looks like the way to go here.

🎀👀🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

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

@MonilBhavsar
Copy link
Contributor

Looks good to me too.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 26, 2023
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 27, 2023
@dukenv0307
Copy link
Contributor

@Ollyws The PR is ready for review
Please note that we have a problem with copying to the clipboard in Android Chrome. We used
Clipboard from '@react-native-clipboard/clipboard' from this PR which is not seem to work in Android Chrome.

Please check this video for more information

chrome_issue-resize.mov

I had to use the old logic so that I could copy the text

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Nov 6, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Nov 6, 2023
@melvin-bot melvin-bot bot changed the title [$500] IOU - Copy to clipboard paid IOU in IOU page, instead of paid text requested text shown [HOLD for payment 2023-11-13] [$500] IOU - Copy to clipboard paid IOU in IOU page, instead of paid text requested text shown Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

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:

Copy link

melvin-bot bot commented Nov 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:

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

@MitchExpensify
Copy link
Contributor

Payment summary:

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Nov 13, 2023
@MitchExpensify
Copy link
Contributor

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

@dukenv0307
Copy link
Contributor

@MitchExpensify accepted, thank you!

@Ollyws
Copy link
Contributor

Ollyws commented Nov 15, 2023

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.

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