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] Web - Thread - Noting happen when clicking "Join thread" button unless returning to inbox again #52472

Open
1 of 8 tasks
IuliiaHerets opened this issue Nov 13, 2024 · 9 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 13, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: v9.0.61-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. (User A) Send any message to 1:1 conversation for the account you have access to
  2. (User B) go to the new message from User A and open context menu
  3. (User B) Click "Join Thread"
  4. Navigating to Settings/Search and go to Inbox again

Expected Result:

The "Join Thread" option should navigate to thread immediately or not navigating at all unless clicking "reply in thread"

Actual Result:

"Join thread" option navigating to "reply in thread" page after navigating to other bottom navigations like Search or Setting and returning back to inbox

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6663491_1731486430970.bandicam_2024-11-13_11-14-04-868.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021858763130278701100
  • Upwork Job ID: 1858763130278701100
  • Last Price Increase: 2024-11-19
Issue OwnerCurrent Issue Owner: @parasharrajat
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 13, 2024
Copy link

melvin-bot bot commented Nov 13, 2024

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.

@FitseTLT
Copy link
Contributor

FitseTLT commented Nov 13, 2024

Edited by proposal-police: This proposal was edited at 2024-11-13 13:06:19 UTC.

Proposal

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

Web - Thread - Noting happen when clicking "Join thread" button unless returning to inbox again

What is the root cause of that problem?

We are unnecessarily displaying join option for report actions that are not parent of a chat thread

return !subscribed && !isWhisperAction && !isTaskAction && !isExpenseReportAction && !isThreadFirstChat && (shouldDisplayThreadReplies || (!isDeletedAction && !isArchivedRoom));

and when we press the join button openReport is called with new child report id here
openReport(newChat.reportID, '', participantLogins, newChat, parentReportAction.reportActionID);

so when we navigate back to the inbox it will be opened as the last accessed report

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

We should only show join option on a report action if there is a chat thread associated with that report action that the user can join into (otherwise the join button will be a duplicate of reply in thread, there only difference being reply in thread opens the child report ). So we should check if the report action has a childReportID to show join menu

return (
                !subscribed &&
                !isWhisperAction &&
                !isTaskAction &&
                !isExpenseReportAction &&
                !isThreadFirstChat &&
                !!reportAction?.childReportID &&
                (shouldDisplayThreadReplies || (!isDeletedAction && !isArchivedRoom))
            );

We won't need the else condition here

} else {

What alternative solutions did you explore? (Optional)

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 13, 2024

Edited by proposal-police: This proposal was edited at 2024-11-19 08:56:27 UTC.

Proposal

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

"Join thread" option navigating to "reply in thread" page after navigating to other bottom navigations like Search or Setting and returning back to inbox

What is the root cause of that problem?

  • Firstly, we need to explain why the join thread option is only shown in non-thread actions of other user

The difference is here, if reportAction?.childReportNotificationPreference is undefined, getChildReportNotificationPreference function returns always if the user is the creator of the action, otherwise it returns hidden

const childReportNotificationPreference = ReportUtils.getChildReportNotificationPreference(reportAction);

App/src/libs/ReportUtils.ts

Lines 1762 to 1768 in b1c1a4b

function getChildReportNotificationPreference(reportAction: OnyxInputOrEntry<ReportAction> | Partial<ReportAction>): NotificationPreference {
const childReportNotificationPreference = reportAction?.childReportNotificationPreference ?? '';
if (childReportNotificationPreference) {
return childReportNotificationPreference;
}
return isActionCreator(reportAction) ? CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS : CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN;

  • When we click on Join thread, a new report is created and when we go back from search it is displayed as the last accessed report

function toggleSubscribeToChildReport(childReportID = '-1', parentReportAction: Partial<ReportAction> = {}, parentReportID = '-1', prevNotificationPreference?: NotificationPreference) {

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

In this function, we should navigate to the thread if we create a new report

Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(newChat.reportID));

updateNotificationPreference(newChat.reportID, prevNotificationPreference, notificationPreference, parentReportID, parentReportAction?.reportActionID);

What alternative solutions did you explore? (Optional)

  • We can hide the Join thread menu item for actions from another user if reportAction?.childReportNotificationPreference is undefined which means doesn't exist . To do that we can get childReportNotificationPreference here from reportAction?.childReportNotificationPreference
const childReportNotificationPreference = reportAction?.childReportNotificationPreference;

https://github.com/Expensify/App/blob/b1c1a4b53746f6e9ba0a7853faaf42695ca4c067/src/pages/home/report/ContextMen
u/ContextMenuActions.tsx#L305

And update the subscribed

const subscribed = !(childReportNotificationPreference === 'hidden');

const subscribed = childReportNotificationPreference !== 'hidden';

@melvin-bot melvin-bot bot added the Overdue label Nov 18, 2024
@stephanieelliott
Copy link
Contributor

Agree this seems buggy, adding labels.

@melvin-bot melvin-bot bot removed the Overdue label Nov 19, 2024
@stephanieelliott stephanieelliott added External Added to denote the issue can be worked on by a contributor Overdue labels Nov 19, 2024
Copy link

melvin-bot bot commented Nov 19, 2024

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

@melvin-bot melvin-bot bot changed the title Web - Thread - Noting happen when clicking "Join thread" button unless returning to inbox again [$250] Web - Thread - Noting happen when clicking "Join thread" button unless returning to inbox again Nov 19, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 19, 2024
Copy link

melvin-bot bot commented Nov 19, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Nov 19, 2024
@parasharrajat
Copy link
Member

parasharrajat commented Nov 19, 2024

Both of the proposals lack clear explanations.

  1. @FitseTLT When you say non-parent actions, what does that mean? Please don't use purely technical terms in explanations. It will help make it more readable. There are non-technical persons also reading these proposals.
  2. @mkzie2 You didn't explain what you are trying to achieve in your alternative solution. It just mentions changes.

Apart from this, the expected behavior here should be that the user does not navigate to the thread in any way. Please update your proposals for it. Ref: #27994

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 19, 2024

@parasharrajat I updated my alternative solution.

@FitseTLT
Copy link
Contributor

@parasharrajat I have tried to make it more readable based on your suggestion. Can you check it again? Thx

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

5 participants