Skip to content

[HOLD for payment 2024-02-07] [$500] Reimbursement - Reimbursement message is not copied with "Copy to clipboard" #34045

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.4.22-0
Reproducible in staging?: Y
Reproducible in production?: N
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. [User A] Request money from User B
  2. [User B] Pay the request
  3. [User A] Go to the paid IOU report
  4. [User A] Right click on reimbursement message > Copy to clipboard
  5. [User A] Paste the content

Expected Result:

The reimbursement message is copied successfully

Actual Result:

The reimbursement message is not copied

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

Add any screenshot/video evidence

Bug6333354_1704475020941.20240105_085906.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01143d94d68559e19a
  • Upwork Job ID: 1743429727276658688
  • Last Price Increase: 2024-01-13

Activity

  1. github-actions commented on Jan 5, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  2. melvin-bot commented on Jan 5, 2024

    @melvin-bot

    Triggered auto assignment to @tylerkaraszewski (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

  3. namhihi237 commented on Jan 5, 2024

    @namhihi237
    Contributor

    Proposal

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

    Can not copy message reimbursement

    What is the root cause of that problem?

    We do not have a logic for copying the type "MARKEDREIMBURSED" of message in here

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

    We should add logic like this

    if (reportAction.actionName === 'MARKEDREIMBURSED') {
     const reimbursMementessage = _.reduce(reportAction.message, (acc, curr) => `${acc}${curr.text}`, '');
     Clipboard.setString(reimbursMementessage);
    }

    What alternative solutions did you explore? (Optional)

  4. gijoe0295 commented on Jan 5, 2024

    @gijoe0295
    Contributor

    Proposal

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

    Reimbursement message is not copied with "Copy to clipboard"

    What is the root cause of that problem?

    We did not cover the case of MARKEDREIMBURSED here.

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

    We should add the check to cover reimbursement message type:

    if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED) {
        const message = ReportActionsUtils.getMarkedReimbursedMessage(reportAction);
        Clipboard.setString(message);
    }

    We should cover other cases of reimbursement messages like REIMBURSEMENTDEQUEUED or REIMBURSEMENTQUEUED as well.

    What alternative solutions did you explore? (Optional)

    I also notice that the TS definition here is insufficient. We should supplement all types of messages to avoid type errors.

  5. bernhardoj commented on Jan 5, 2024

    @bernhardoj
    Contributor

    Proposal

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

    Copying reimbursed system message copies nothing.

    What is the root cause of that problem?

    The reimbursed system message object only contains text property and not html.
    image

    When we press copy to clipboard, we only take the last message html.

    function getActionText(reportAction: OnyxEntry<ReportAction>): string {
    const message = reportAction?.message?.at(-1) ?? null;
    return message?.html ?? '';
    }

    const messageHtml = isTaskAction ? TaskUtils.getTaskReportActionMessage(reportAction?.actionName) : getActionText(reportAction);

    So, the copy to clipboard fails to copy the message.

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

    Previously, we had a similar issue for SUBMITTED action and the solution is to concat all message text.

    } else if (ReportActionsUtils.isSubmittedExpenseAction(reportAction)) {
    const submittedMessage = reportAction?.message?.reduce((acc, curr) => `${acc}${curr.text}`, '');
    Clipboard.setString(submittedMessage ?? '');
    } else if (content) {

    But instead of handling it case by case, we can make it a general case. So, in addition to messageHtml, we can create messageText which is the result of all the messages' concatenation. Then, we will use it as the last fallback.

    const messageText = reportAction?.message?.reduce((acc, curr) => `${acc}${curr.text}`, '');
    
    } else if (messageText) {
        Clipboard.setString(messageText)
    }
    
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    ExternalAdded to denote the issue can be worked on by a contributor
    and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jan 6, 2024
  7. melvin-bot commented on Jan 6, 2024

    @melvin-bot
  8. changed the title [-] Reimbursement - Reimbursement message is not copied with "Copy to clipboard"[/-] [+][$500] Reimbursement - Reimbursement message is not copied with "Copy to clipboard"[/+] on Jan 6, 2024
  9. 52 remaining items

  10. melvin-bot commented on Feb 7, 2024

    @melvin-bot

    Issue is ready for payment but no BZ is assigned. @muttmuure you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!

  11. melvin-bot commented on Feb 7, 2024

    @melvin-bot

    Payment Summary

    Upwork Job

    • ROLE: @fedirjh paid $(AMOUNT) via Upwork (LINK)
    • ROLE: @bernhardoj paid $(AMOUNT) via Upwork (LINK)

    BugZero Checklist (@muttmuure)

    • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1743429727276658688/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  12. fedirjh commented on Feb 7, 2024

    @fedirjh
    Contributor

    @muttmuure C+ payment should be issued to @0xmiroslav as he has fully reviewed the PR.

  13. muttmuure commented on Feb 9, 2024

    @muttmuure
    Contributor
  14. melvin-bot commented on Feb 12, 2024

    @melvin-bot

    @tylerkaraszewski, @fedirjh, @muttmuure, @bernhardoj Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  15. muttmuure commented on Feb 12, 2024

    @muttmuure
    Contributor

    Offer sent to @bernhardoj

  16. muttmuure commented on Feb 12, 2024

    @muttmuure
    Contributor

    Waiting for @0xmiroslav to accept

  17. muttmuure commented on Feb 13, 2024

    @muttmuure
    Contributor

    Going to close for now, @0xmiroslav please reopen when you'd like to be paid

  18. bernhardoj commented on Apr 9, 2024

    @bernhardoj
    Contributor

    @muttmuure Hi, I was scanning through my pending payment and saw that I haven't been paid yet on this one. Here is the offer that I was checking, could you kindly check it on your side?

  19. mallenexpensify commented on Apr 9, 2024

    @mallenexpensify
    Contributor

    Contributor: @bernhardoj paid $500 via Upwork
    Sorry we missed that @bernhardoj

  20. bernhardoj commented on Apr 10, 2024

    @bernhardoj
    Contributor
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.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions