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-22] [$500] Difference between last message on LHN and task action message when canceled a task #30437

Closed
6 tasks done
m-natarajan opened this issue Oct 26, 2023 · 27 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

@m-natarajan
Copy link

m-natarajan commented Oct 26, 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!


Version Number: 1.3.91-5
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: @namhihi237
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1697129972953389

Action Performed:

  1. Open a chat
  2. Click plus button in composer
  3. Click assign task and create a task
  4. Cancel the task, Observe the last message on LHN and task report differently.

Expected Result:

Last message on LHN and task report are the same when canceled task

Actual Result:

last message on LHN and task report differently.

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
Screen.Recording.2023-10-13.at.00.03.21.mov
Android: mWeb Chrome
Screen.Recording.2023-10-13.at.00.04.34.mov
iOS: Native
RPReplay_Final1697130092.MP4
iOS: mWeb Safari
RPReplay_Final1697130137.MP4
MacOS: Chrome / Safari
Screen.Recording.2023-10-13.at.00.05.28.mov
Recording.165.mp4
MacOS: Desktop
Screen.Recording.2023-10-13.at.00.05.28.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0162e3426964bd58f2
  • Upwork Job ID: 1717528650049146880
  • Last Price Increase: 2023-11-02
  • Automatic offers:
    • jjcoffee | Reviewer | 27513102
    • namhihi237 | Contributor | 27513103
    • namhihi237 | Reporter | 27513105
Issue OwnerCurrent Issue Owner: @johncschuster
@m-natarajan m-natarajan added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 26, 2023
@melvin-bot melvin-bot bot changed the title Difference between last message on LHN and task action message when canceled a task [$500] Difference between last message on LHN and task action message when canceled a task Oct 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0162e3426964bd58f2

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

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

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

@m-natarajan
Copy link
Author

Proposal by @namhihi237

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

The last message on LNH is different last message on the task report when cancel the task

What is the root cause of that problem?

We only have the logic showing completed and reopened task in LHn here so when canceling it is taking the value from the backend and there is no translation.

} else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKREOPENED) {
result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.reopened')}`;
} else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED) {
result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.completed')}`;

In Task action in the report, we are using the function getTaskReportActionMessage to get the message task action
<Text style={[styles.chatItemMessage, styles.colorMuted]}>{Task.getTaskReportActionMessage(props.actionName, props.taskReportID, false)}</Text>

That's why there is a difference here.

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

We should add logic to show the last message on LHN when the task canceled

else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED) {
    result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.canceled')}`;
}

Or we can use the function getTaskReportActionMessage for consistency:

else if (ReportActionsUtils.isTaskAction(lastAction)) {
   result.alternateText = Task.getTaskReportActionMessage(lastAction.actionName, report.reportID, false);
}

What alternative solutions did you explore? (Optional)

In addition, we can update the message when canceling the task

const message = `deleted task: ${taskTitle}`;

Or we can update the action message on the same backend/

@DylanDylann
Copy link
Contributor

This bug is discovered and I posted a solution to resolve this bug before

Re-post proposal here

Proposal

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

Difference between last message on LHN and task action message when canceled a task

What is the root cause of that problem?

The translation for complete task and re-open task work well in LHN because we have logic to update alternativeText in getOptionData for LHN options

} else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKREOPENED) {
result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.reopened')}: ${report.reportName}`;
} else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED) {
result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.completed')}: ${report.reportName}`;
} else {

But we don't have logic for the translation cancel task

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

  1. we need to translate cancelled task in LHN

} else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKREOPENED) {
result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.reopened')}: ${report.reportName}`;
} else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED) {
result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.completed')}: ${report.reportName}`;
} else {

add condition:

else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED) {
                result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.canceled')}: ${report.reportName}`;
            }

Optional: 2. Update complete task, reopen task and cancel task in share destination options
In here:

if (result.isChatRoom || result.isPolicyExpenseChat) {

we should add

if ((result.isChatRoom || result.isPolicyExpenseChat || result.isThread || result.isTaskReport)) {
            const lastAction = visibleReportActionItems[report.reportID];
            if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.RENAMED) {
                const newName = lodashGet(lastAction, 'originalMessage.newName', '');
                result.alternateText = Localize.translate(preferredLocale, 'newRoomPage.roomRenamedTo', {newName});
            } else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKREOPENED) {
                result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.reopened')}: ${report.reportName}`;
            } else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED) {
                result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.completed')}: ${report.reportName}`;
            } else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED) {
                result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.canceled')}: ${report.reportName}`;
            }
}

With this approach, we need to define visibleReportActionItems as we did in SidebarUtils.
We also can consider to create utils function to update alternative text to avoid duplicated code

@brianmuks
Copy link
Contributor

Proposal

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

Difference between last message on LHN and task action message when canceled a task

What is the root cause of that problem?

When a task is deleted the backend returns deleted as the alternateText which is rendered directly here:

{optionItem.alternateText}

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

Borrowing from this concepts:

const isDeletedParentAction = ReportUtils.isCanceledTaskReport(props.taskReport, props.action);

we can add one line :

    optionItem.alternateText = (optionItem.alternateText === 'deleted', optionItem.isTaskReport) ? translate('task.messages.canceled') : optionItem.alternateText;

What alternative solutions did you explore? (Optional)
N/A

@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2023
@jjcoffee
Copy link
Contributor

I think we're good to go with @namhihi237's proposal here. The RCA is correct and the fix is nice and simple - I do also like the idea of using getTaskReportActionMessage for consistency.

@namhihi237 Please comment in this thread so that you can be assigned.

🎀👀🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Nov 1, 2023
@johncschuster
Copy link
Contributor

johncschuster commented Nov 1, 2023

Not overdue. @namhihi237, please comment on the issue so we can assign it to you!

@melvin-bot melvin-bot bot removed the Overdue label Nov 1, 2023
@namhihi237
Copy link
Contributor

@johncschuster thanks

Copy link

melvin-bot bot commented Nov 2, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added Overdue and removed Help Wanted Apply this label when an issue is open to proposals by contributors labels Nov 4, 2023
Copy link

melvin-bot bot commented Nov 4, 2023

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

Copy link

melvin-bot bot commented Nov 4, 2023

📣 @namhihi237 🎉 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 📖

Copy link

melvin-bot bot commented Nov 4, 2023

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

@roryabraham
Copy link
Contributor

Not overdue, just assigned

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Overdue Daily KSv2 labels Nov 4, 2023
@roryabraham
Copy link
Contributor

PR merged

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 15, 2023
@melvin-bot melvin-bot bot changed the title [$500] Difference between last message on LHN and task action message when canceled a task [HOLD for payment 2023-11-22] [$500] Difference between last message on LHN and task action message when canceled a task Nov 15, 2023
Copy link

melvin-bot bot commented Nov 15, 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 15, 2023
Copy link

melvin-bot bot commented Nov 15, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.99-0 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-22. 🎊

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 15, 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:

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

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

  • The PR that introduced the bug has been identified. Link to the PR: N/A - looks like the behaviour has always been there
  • 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. Yes
  • 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.

Regression Test Proposal

  1. Open any chat
  2. Click + in composer and Assign task
  3. Fill out any details to create the task
  4. Cancel the task
  5. Verify that the last message on LHN and task report both display the same message, deleted task

Do we agree 👍 or 👎

@jjcoffee
Copy link
Contributor

@johncschuster Checklist complete, friendly bump for payment! 🙇

@melvin-bot melvin-bot bot added the Overdue label Nov 27, 2023
Copy link

melvin-bot bot commented Nov 28, 2023

@johncschuster, @jjcoffee, @namhihi237, @roryabraham Huh... This is 4 days overdue. Who can take care of this?

@roryabraham
Copy link
Contributor

@johncschuster bump for payment

@melvin-bot melvin-bot bot removed the Overdue label Nov 28, 2023
@johncschuster
Copy link
Contributor

Thanks for the pings, everyone! Working on this now.

@johncschuster
Copy link
Contributor

Ok folks! Payment has been issued! Thanks for your patience!

@johncschuster
Copy link
Contributor

(Leaving this open for me to create the Regression test issue)

@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2023
@melvin-bot melvin-bot bot removed the Overdue label Dec 4, 2023
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

7 participants