Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.55k stars 2.9k forks source link

[HOLD for payment 2024-11-14] [$250] Task – Join thread option is present in context menu on deleted task with subtask #50566

Open lanitochka17 opened 1 month ago

lanitochka17 commented 1 month ago

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: 9.0.47-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: N/A Email or phone of affected tester (no customers): applausetester+jp_e_category_1@applause.expensifail.com Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Log in
  3. Open any chat
  4. Create a task
  5. Open task details and create a subtask
  6. Click on the header and delete task
  7. Go back to main chat and right click on the deleted task

Expected Result:

Join thread option is not present

Actual Result:

Join thread option is present in context menu on deleted task with subtask, but not present on deleted task with a comment

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/732ac4f6-4bb5-4ae1-a610-1a7b0628a271

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021844593880462626496
  • Upwork Job ID: 1844593880462626496
  • Last Price Increase: 2024-10-18
Issue OwnerCurrent Issue Owner: @stephanieelliott
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @stephanieelliott (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

lanitochka17 commented 1 month ago

@stephanieelliott FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

bernhardoj commented 1 month ago

Proposal

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

A join thread option shows for a task preview.

What is the root cause of that problem?

This not only happens with a deleted task, but just with a new task. When we create a new task, the notificationPreference is hidden. In this case, the subscribed is false and we don't have any condition to check whether it's a task or not, so the Join thread is shown. https://github.com/Expensify/App/blob/517ffaaf4aad021872c8c9f1b7e73ae8366fb5ca/src/pages/home/report/ContextMenu/ContextMenuActions.tsx#L336-L341

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

Add a check for task action, if it's a task action, don't show the join thread.

const isTaskAction = ReportActionsUtils.isCreatedTaskReportAction(reportAction);
return !subscribed && !isWhisperAction && !isTaskAction && ...;
melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

nkdengineer commented 1 month ago

Proposal

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

Join thread option is present in context menu on deleted task with subtask

What is the root cause of that problem?

We have two problems here:

  1. The Join button is also shown when we create the task. The RCA is we don't have any condition here to prevent showing the join button if the action is created task action
const isTaskCreatedAction = ReportActionsUtils.isCreatedTaskReportAction(reportAction);
return !subscribed && !isWhisperAction && !isExpenseReportAction && !isThreadFirstChat && !isTaskCreatedAction && (shouldDisplayThreadReplies || (!isDeletedAction && !isArchivedRoom));

https://github.com/Expensify/App/blob/4c90d62a6a56ff0000031eceeb9195d30a041a8a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx#L340

  1. The Join button is still shown if we create a task in the task report. In this case, I think the current problem is the notificationPreference is still hidden after we create a task in the task report.

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

  1. We should add a check not to show the join button if the action is the created task action

https://github.com/Expensify/App/blob/4c90d62a6a56ff0000031eceeb9195d30a041a8a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx#L340

  1. When we create a new task, we should check if the notificationPreference is hidden, we should update this and update childReportNotificationPreference of the parent report action to always

Backend also needs to update the report's' `notificationPreference' in this case.

What alternative solutions did you explore? (Optional)

melvin-bot[bot] commented 1 month ago

@stephanieelliott, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!

stephanieelliott commented 1 month ago

Hey @getusha there are 2 proposals here, can you please review when you get a sec?

stephanieelliott commented 1 month ago

Hey @getusha there are 2 proposals here, can you please review when you get a sec?

^^ Bump on this @getusha

melvin-bot[bot] commented 4 weeks ago

@stephanieelliott, @getusha Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] commented 3 weeks ago

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

melvin-bot[bot] commented 3 weeks ago

@stephanieelliott, @getusha 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] commented 3 weeks ago

@stephanieelliott, @getusha 10 days overdue. I'm getting more depressed than Marvin.

stephanieelliott commented 3 weeks ago

Hey @getusha another bump, can you review the proposals here please? If I we don't hear from you today I'll post this in Slack to see if we can get someone else to take this one

getusha commented 3 weeks ago

When we create a new task, we should check if the notificationPreference is hidden, we should update this and update childReportNotificationPreference of the parent report action to always

Why do we need this @nkdengineer it's not quite clear for me

bernhardoj commented 3 weeks ago

That's a different issue and already being handled here

getusha commented 3 weeks ago

@bernhardoj's proposal looks good to me 🎀 👀 🎀 C+ Reviewed

melvin-bot[bot] commented 3 weeks ago

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

melvin-bot[bot] commented 3 weeks ago

@stephanieelliott @grgia @getusha this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

stephanieelliott commented 2 weeks ago

Lil bump @grgia, wanna review the selected proposal when you get a sec/

grgia commented 2 weeks ago

Back from OOO, assigning

bernhardoj commented 2 weeks ago

PR is ready

cc: @getusha

stephanieelliott commented 1 week ago

PR is just awaiting internal review

melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.58-2 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-11-14. :confetti_ball:

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

melvin-bot[bot] commented 1 week ago

@getusha @stephanieelliott The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

melvin-bot[bot] commented 1 day ago

Payment Summary

Upwork Job

BugZero Checklist (@stephanieelliott)

bernhardoj commented 1 day ago

Requested in ND.