Skip to content

[HOLD for payment 2024-02-20] [$500] Copy icon - Clicking copy icon on an offline deleted message doesn't copy the message #33893

Closed

Description

@kbecciv

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.21-1
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Disable the internet connection in the main testing device
  2. Choose the first of several messages you have already sent back-to-back
  3. Hover over that first message
  4. Click on the Trash icon to delete the message
  5. Hover over the deleted message
  6. Click on 'copy to clipboard' icon
  7. Paste the content in the composer

Expected Result:

Content should be copied or copy to clipboard icon shouldn't be available

Actual Result:

Copy to clipboard icon is available, and content can't 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

Bug6331546_1704306396563.Screen_Recording_2024-01-03_at_6.16.54_in_the_evening.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012f0dc88d1cf0e7f2
  • Upwork Job ID: 1742619965562798080
  • Last Price Increase: 2024-01-24
  • Automatic offers:
    • bernhardoj | Contributor | 28142533

Activity

  1. added
    External
    Daily
    Bug
    on Jan 3, 2024
  2. changed the title [-]Copy icon - Clicking copy icon on an offline deleted message doesn't copy the message[/-] [+][$500] Copy icon - Clicking copy icon on an offline deleted message doesn't copy the message[/+] on Jan 3, 2024
  3. melvin-bot commented on Jan 3, 2024

    @melvin-bot

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

  4. melvin-bot commented on Jan 3, 2024

    @melvin-bot
  5. added
    Help Wanted
    on Jan 3, 2024
  6. melvin-bot commented on Jan 3, 2024

    @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
  7. melvin-bot commented on Jan 3, 2024

    @melvin-bot

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

  8. namhihi237 commented on Jan 3, 2024

    @namhihi237
    Contributor

    Proposal

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

    Content should be copied or copy to clipboard icon shouldn't be available

    What is the root cause of that problem?

    We have logic show icon copy here.

    shouldShow: (type, reportAction) =>
    type === CONST.CONTEXT_MENU_TYPES.REPORT_ACTION && !ReportActionsUtils.isReportActionAttachment(reportAction) && !ReportActionsUtils.isMessageDeleted(reportAction),
    // If return value is true, we switch the `text` and `icon` on

    We only check the reportAction deleted

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

    Option 1: Do not show the icon copy
    We should add the condition pendingAction is not delete
    Option 2: Can copy:
    We can get from originalMessage if the pendingAction is delete and the previousMessage because when offline we edit and delete. we should prioritize from previousMessage.

    const messageHtml = isTaskAction ? TaskUtils.getTaskReportActionMessage(reportAction.actionName) : lodashGet(message, 'html', '') || lodashGet(lodashGet(reportAction, 'previousMessage', {}), 'html', '')  || lodashGet(lodashGet(reportAction, 'originalMessage', {}), 'html', '')

    What alternative solutions did you explore? (Optional)

    In addition, currently, I see that when a message has a pendingAction of delete, we can still react, and mark as unread,...
    I think they should be hidden because when online messages are deleted, the above actions have no meaning.

  9. FitseTLT commented on Jan 3, 2024

    @FitseTLT
    Contributor

    Proposal

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

    Clicking copy icon on an offline deleted message doesn't copy the message

    What is the root cause of that problem?

    It's because message.html of the report action is empty for deleted message here

    const messageHtml = isTaskAction ? TaskUtils.getTaskReportActionMessage(reportAction.actionName) : lodashGet(message, 'html', '');

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

    We should fallback to originalMessage.html for cases where message.html is empty

    const messageHtml = isTaskAction
                    ? TaskUtils.getTaskReportActionMessage(reportAction.actionName)
                    : lodashGet(message, 'html', '') || lodashGet(lodashGet(reportAction, 'originalMessage', {}), 'html', '');
    
    

    What alternative solutions did you explore? (Optional)

  10. FitseTLT commented on Jan 3, 2024

    @FitseTLT
    Contributor

    @namhihi237 you are incorporating my proposal in your option 2 without notifying updated comment

  11. namhihi237 commented on Jan 3, 2024

    @namhihi237
    Contributor

    Updated proposal add option 2 and additional view in alternative

  12. 67 remaining items

  13. changed the title [-][$500] Copy icon - Clicking copy icon on an offline deleted message doesn't copy the message[/-] [+][HOLD for payment 2024-02-20] [$500] Copy icon - Clicking copy icon on an offline deleted message doesn't copy the message[/+] on Feb 13, 2024
  14. removed
    Reviewing
    on Feb 13, 2024
  15. melvin-bot commented on Feb 13, 2024

    @melvin-bot

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

  16. melvin-bot commented on Feb 13, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.40-5 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 2024-02-20. 🎊

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

  17. melvin-bot commented on Feb 13, 2024

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

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

    @mananjadhav
    Collaborator

    We have the offending PR and I raised the comment here.

    I don't think we need a regression test.

    @muttmuure this would be ready for payout tomorrow. Worked on the checklist.

  19. added
    Daily
    and removed
    Weekly
    on Feb 20, 2024
  20. mananjadhav commented on Feb 23, 2024

    @mananjadhav
    Collaborator

    quick bump @muttmuure

  21. muttmuure commented on Feb 23, 2024

    @muttmuure
    Contributor

    $500 to @mananjadhav for C+

  22. muttmuure commented on Feb 23, 2024

    @muttmuure
    Contributor

    All paid up

  23. JmillsExpensify commented on Feb 27, 2024

    @JmillsExpensify
    Contributor

    $500 approved for @mananjadhav based on summary above.

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions