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-09-29] [$500] Assign task - Colon (:) added to completed/reopened task messages when copy pasting #26753

Closed
1 of 6 tasks
izarutskaya opened this issue Sep 5, 2023 · 36 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

@izarutskaya
Copy link

izarutskaya commented Sep 5, 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. login to staging new dot
  2. Go to any chat with a task
  3. Copy the completed or reopened task message using the copy to clipboard icon
  4. Paste the copied content in the composer and observe that a colon is added after completed or reopend when pasting

Expected Result:

Pasted content should be identical to copied content

Actual Result:

Pasted content has colon

Workaround:

Unknown

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: v1.3.63-0

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

scrnli_8_25_2023_8-37-21.PM.mp4
Recording.1448.mp4

Expensify/Expensify Issue URL:

Issue reported by: @SofoniasN @oleksandr-pantsyr (reported first here)

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692985594255829

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012810233ffe197834
  • Upwork Job ID: 1699809589610123264
  • Last Price Increase: 2023-09-07
  • Automatic offers:
    • Ollyws | Reviewer | 26589564
    • sofoniasN | Reporter | 26589566
    • oleksandr-pantsyr | Contributor | 26974844
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 5, 2023
@DylanDylann
Copy link
Contributor

DylanDylann commented Sep 5, 2023

Proposal

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

  • Colon (:) added to completed/reopened task messages when copy pasting

What is the root cause of that problem?

  • Currently, the copied text is from the originalMessage that has the colon (:):
    const originalMessage = _.get(reportAction, 'originalMessage', {});
  • But the displayed task action message is from: ${taskStatusText} ${taskReportName} that does not has the colon (:):
    function TaskAction(props) {
    const taskReportName = props.taskReport.reportName || '';
    let taskStatusText = '';
    switch (props.actionName) {
    case CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED:
    taskStatusText = props.translate('task.messages.completed');
    break;
    case CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED:
    taskStatusText = props.translate('task.messages.canceled');
    break;
    case CONST.REPORT.ACTIONS.TYPE.TASKREOPENED:
    taskStatusText = props.translate('task.messages.reopened');
    break;
    default:
    taskStatusText = props.translate('task.task');
    }
    return (
    <>
    <View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter]}>
    <Text style={[styles.chatItemMessage, styles.colorMuted]}>{`${taskStatusText} ${taskReportName}`}</Text>
    </View>
    </>
    );
    }

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

  • We can change the way to get the copied text to the same way that used to get the task action message like below:
  • Create the getTaskReportActionMessage that is used for both <TaskAction /> and copiedText:
const getTaskReportMessage = (reportAction, translate) => {
    const taskReport = ReportUtils.getReport(reportAction.originalMessage.taskReportID.toString());
    const taskReportName = taskReport.reportName || '';

    let taskStatusText = '';
    switch (reportAction.actionName) {
        case CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED:
            taskStatusText = translate('task.messages.completed');
            break;
        case CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED:
            taskStatusText = translate('task.messages.canceled');
            break;
        case CONST.REPORT.ACTIONS.TYPE.TASKREOPENED:
            taskStatusText = translate('task.messages.reopened');
            break;
        default:
            taskStatusText = translate('task.task');
    }
    return `${taskStatusText} ${taskReportName}`;
};

What alternative solutions did you explore? (Optional)

  • NA

@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 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

@BhuvaneshPatil
Copy link
Contributor

Proposal

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

What is the root cause of that problem?

We use originalMessage to get the text to be copied here -

const messageHtml = isTaskAction ? lodashGet(originalMessage, 'html', '') : lodashGet(message, 'html', '');

and it looks like this
Screenshot 2023-09-05 at 5 00 36 PM

Observe it contains semicolon.
but while rendering it we display that separately(prop translation)

<>
<View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter]}>
<Text style={[styles.chatItemMessage, styles.colorMuted]}>{`${taskStatusText} ${taskReportName}`}</Text>
</View>
</>
);
}

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

There are two approaches that to solve this -

  • We either change the TaskAction and add colon there
<Text style={[styles.chatItemMessage, styles.colorMuted]}>{`${taskStatusText}: ${taskReportName}`}</Text>

For this we can create a new method in ReportActionUtils - getTaskActionText(actionName) it will return translated key for all the CONST.REPORT.ACTIONS.TYPE and then use it on above mentioned line while copying the text

What alternative solutions did you explore? (Optional)

@zanyrenney
Copy link
Contributor

Yep, reproducible here - adding external.

@zanyrenney zanyrenney added the External Added to denote the issue can be worked on by a contributor label Sep 7, 2023
@melvin-bot melvin-bot bot changed the title Assign task - Colon (:) added to completed/reopened task messages when copy pasting [$500] Assign task - Colon (:) added to completed/reopened task messages when copy pasting Sep 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

Job added to Upwork: https://www.upwork.com/jobs/~012810233ffe197834

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

melvin-bot bot commented Sep 7, 2023

Current assignee @zanyrenney is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

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

@Ollyws
Copy link
Contributor

Ollyws commented Sep 9, 2023

The problem is we are copying originalMessage which is redundant here, also it doesn't translate when the language is changed. We should be copying the localization as that's what's displayed, so @DylanDylann's proposal looks good to me.
🎀👀🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 9, 2023

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

@luacmartins
Copy link
Contributor

Agreed with C+ assessment.

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

melvin-bot bot commented Sep 10, 2023

📣 @Ollyws 🎉 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 10, 2023

📣 @DylanDylann You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Sep 10, 2023

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

@DylanDylann
Copy link
Contributor

@Ollyws @luacmartins The PR #27119 ready for review

@parasharrajat
Copy link
Member

If we are solving this issue here, we should solve it completely to cover all the cases.

  1. Tasks [$500] Web - Assigned task title doesn't update when copying after changing it #26571
  2. IOU. [$500] The updated amount is not copied to clipboard. #26664
  3. other such actions.

I would still suggest that we wait as it have been confirmed a regression from #24569 (comment)

@pecanoro
Copy link
Contributor

pecanoro commented Sep 12, 2023

This got a bit chaotic, mostly because #26571 was opened and reported before this one so the other one should take priority. That means that we won't be paying the reporting bonus for this one.

However, we DO need to fix all cases in one single PR. That means that either @DylanDylann, you fix all problems in your PR or the original contributor does it.

@DylanDylann
Copy link
Contributor

@pecanoro I will fix all cases in my PR. My current PR also fix #26571

@pecanoro
Copy link
Contributor

Awesome, glad to hear! I will close the other one!

@zanyrenney The original reporter is @oleksandr-pantsyr since this was a duplicate with the same root cause.

@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 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-10 06:02:55 Z
  • when the PR got merged: 2023-09-19 01:01:37 UTC
  • days elapsed: 5

On to the next one 🚀

@DylanDylann
Copy link
Contributor

DylanDylann commented Sep 21, 2023

The PR is out of scope to fix some related issues. It caused the timeline to extend beyond 3 days

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 22, 2023
@melvin-bot melvin-bot bot changed the title [$500] Assign task - Colon (:) added to completed/reopened task messages when copy pasting [HOLD for payment 2023-09-29] [$500] Assign task - Colon (:) added to completed/reopened task messages when copy pasting Sep 22, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.72-11 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-09-29. 🎊

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 Sep 22, 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.
  • [@zanyrenney] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@oleksandr-pantsyr
Copy link

Hi @pecanoro @izarutskaya

I've not got an offer in Upwork. It seems to go to the original reporter.

Could you resolve this issue?

@pecanoro
Copy link
Contributor

I don't think we have sent any offers yet, we will handle after the regression period.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

📣 @oleksandr-pantsyr 🎉 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 melvin-bot bot added the Overdue label Oct 2, 2023
@zanyrenney
Copy link
Contributor

zanyrenney commented Oct 2, 2023

@Ollyws requires payment offer (Reviewer) $500 PAID
@DylanDylann requires payment $500
@oleksandr-pantsyr requires payment for reporting bonus $50 (PAID $500 accidentally so requested refund for $450)

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@zanyrenney
Copy link
Contributor

waiting on @DylanDylann and @oleksandr-pantsyr to accept job offers.

@zanyrenney
Copy link
Contributor

ugh upwork automation messed this one up and gave the payment for @oleksandr-pantsyr wrong. i have reached out to them In DM to request they decline the payment - when I try to submit a refund i get this error:
2023-10-02_15-34-43

@DylanDylann
Copy link
Contributor

DylanDylann commented Oct 3, 2023

This PR lasted long time because this PR is out of scope (fix another issue) as mentioned #26753 (comment). So are we eligible for a bonus here? The PR may be merged sooner if only fix this issue

@pecanoro @Ollyws Could you help to check this? Many thanks

@zanyrenney
Copy link
Contributor

Sorry @DylanDylann this doesn't qualify for the bonus, the rules are set on the days taken to merge. As with all issues, we try to be as fair as possible but are operating within the guidelines set.

@Ollyws
Copy link
Contributor

Ollyws commented Oct 3, 2023

BugZero Checklist:
I don't think we can really say this is a regression from any PR, as the context-menu has been copying the message from the backend here since its implementation.
I don't think a regression test would be helpful here because: It's not related to an important flow, it's not particularly easy to test for nor is it an impactful bug.

@zanyrenney
Copy link
Contributor

All paid out!

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

9 participants