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

[$250] Thread – Unable to leave thread in a task detail. #44964

Closed
4 of 6 tasks
m-natarajan opened this issue Jul 8, 2024 · 23 comments
Closed
4 of 6 tasks

[$250] Thread – Unable to leave thread in a task detail. #44964

m-natarajan opened this issue Jul 8, 2024 · 23 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Jul 8, 2024

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: v9.0.5-3

Reproducible in staging?: y
Reproducible in production?: n
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4700550
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. Go to https://staging.new.expensify.com/
  2. Log in
  3. Open any chat
  4. Send a message
  5. Right click on the message and select Reply in thread
  6. Send a message in a thread
  7. Click on the header

Expected Result:

Leave thread option is present in a task detail

Actual Result:

Leave thread option is missing in a task detail

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

Bug6535884_1720445500918.Leave_thread.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0186cdebe249073b07
  • Upwork Job ID: 1810358159239707374
  • Last Price Increase: 2024-07-08
  • Automatic offers:
    • akinwale | Reviewer | 103047193
Issue OwnerCurrent Issue Owner: @akinwale
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jul 8, 2024
Copy link

melvin-bot bot commented Jul 8, 2024

Triggered auto assignment to @puneetlath (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Jul 8, 2024

Triggered auto assignment to @abekkala (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.

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jul 8, 2024
Copy link
Contributor

github-actions bot commented Jul 8, 2024

👋 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.

@m-natarajan
Copy link
Author

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

@m-natarajan
Copy link
Author

We think that this bug might be related to #vip-vsb

@bernhardoj
Copy link
Contributor

Proposal

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

There is no option to leave thread in report details page.

What is the root cause of that problem?

The condition of showing the leave button requires the report to not be a thread.

const shouldShowLeaveButton =
!isThread && (isGroupChat || (isChatRoom && ReportUtils.canLeaveChat(report, policy)) || (isPolicyExpenseChat && !report.isOwnPolicyExpenseChat && !isPolicyAdmin));

Previously, we had a 3-dot button that shows the leave option for the thread, but now it's removed, but the leave button condition isn't updated yet.

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

I propose that we just use ReportUtils.canLeaveChat function to check whether we can leave a report or not. Then, we can move the other current conditions to canLeaveChat.

const shouldShowLeaveButton = ReportUtils.canLeaveChat(report, policy)

function canLeaveChat(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>): boolean {
    if (isGroupChat) return true;
    if (isPolicyExpenseChat && !report.isOwnPolicyExpenseChat && !isPolicyAdmin) return true;
    ...

Last, we need to update the leaveChat logic so that leaving a thread will call leaveRoom instead of leaveGroupChat.

const leaveChat = useCallback(() => {
Navigation.dismissModal();
if (isChatRoom) {
const isWorkspaceMemberLeavingWorkspaceRoom = (report.visibility === CONST.REPORT.VISIBILITY.RESTRICTED || isPolicyExpenseChat) && isPolicyEmployee;
Report.leaveRoom(report.reportID, isWorkspaceMemberLeavingWorkspaceRoom);
return;
}
Report.leaveGroupChat(report.reportID);
}, [isChatRoom, isPolicyEmployee, isPolicyExpenseChat, report.reportID, report.visibility]);

We can do that by switching the check.

if (isGroupChat) {
    leaveGroupChat()
    return;
}
leaveRoom()

@puneetlath puneetlath added Daily KSv2 External Added to denote the issue can be worked on by a contributor and removed DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API Hourly KSv2 labels Jul 8, 2024
@melvin-bot melvin-bot bot changed the title Thread – Unable to leave thread in a task detail. [$250] Thread – Unable to leave thread in a task detail. Jul 8, 2024
Copy link

melvin-bot bot commented Jul 8, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 8, 2024
Copy link

melvin-bot bot commented Jul 8, 2024

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

@puneetlath
Copy link
Contributor

I don't think this needs to block the deploy. Going to demote it and make it external.

@akinwale
Copy link
Contributor

akinwale commented Jul 9, 2024

@bernhardoj's proposal works here.

🎀👀🎀 C+ reviewed.

Copy link

melvin-bot bot commented Jul 9, 2024

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 9, 2024
Copy link

melvin-bot bot commented Jul 9, 2024

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

@puneetlath
Copy link
Contributor

Sounds good. I like consolidating the logic into ReportUtils.canLeaveChat.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 10, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @akinwale

@abekkala
Copy link
Contributor

waiting on PR Review @akinwale

Copy link

melvin-bot bot commented Jul 22, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented Jul 22, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@abekkala
Copy link
Contributor

deployed to production Jul 23

@akinwale
Copy link
Contributor

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:

  • [@akinwale] The PR that introduced the bug has been identified. Link to the PR:
  • [@akinwale] 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:

This was a regression from #44252.

  • [@akinwale] 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:
  • [@akinwale] Determine if we should create a regression test for this bug.
  • [@akinwale] 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 Steps

  • Launch Expensify
  • Open a chat report
  • Send a message
  • Reply in the thread of the message that was sent
  • Click or tap on the chat header
  • Verify that the Leave option is displayed in the menu

Do we agree 👍 or 👎?

@abekkala
Copy link
Contributor

PAYMENT SUMMARY FOR JULY 30

@abekkala
Copy link
Contributor

@akinwale payment sent and contract ended - thank you!

@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants