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.48k stars 2.84k forks source link

Compose Box - After create a group task user is not redirected to task conversation #51047

Open lanitochka17 opened 2 days ago

lanitochka17 commented 2 days 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.50 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5083366&group_by=cases:section_id&group_order=asc&group_id=291936 Email or phone of affected tester (no customers): aatweq+22222223@gmail.com Issue reported by: Applause - Internal Team

Action Performed:

  1. Loggin on macOS app
  2. Navigate to a Group Chat
  3. Click on the + in the compose box and select "Assign task"
  4. Enter a Title and a Description
  5. Do not assign any group member
  6. Create the task

Expected Result:

After the user creates a task he/she should be redirected to the task conversation

Actual Result:

After the user creates a task he/she is redirected to the group conversation

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/346b1e17-dc0c-4331-b9ff-917ac3e42141

View all open jobs on GitHub

melvin-bot[bot] commented 2 days ago

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

shahinyan11 commented 2 days ago

Edited by proposal-police: This proposal was edited at 2024-10-17 18:38:25 UTC.

Proposal

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

Compose Box - After create a group task user is not redirected to task conversation

What is the root cause of that problem?

Here we navigate to parent report screen after created the task.

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

Use optimisticTaskReport.reportID instead of parentReportID in Navigation.dismissModal

Navigation.dismissModal(optimisticTaskReport.reportID);

What alternative solutions did you explore? (Optional)

jaydamani commented 2 days ago

Proposal

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

After create a group task user is not redirected to task conversation

What is the root cause of that problem?

When we create task, we only dismiss the modal and there is no other navigation logic.

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

In CreateTaskAndNavigate, Check if task has no assignee and is in group report then navigate user to the taskReport else do the current logic (dismiss modal). The condition for group report and no assignee is assumption based on steps in issue and can be changed if the requirement is different.

We need to update below portion in CreateTaskAndNavigate: https://github.com/Expensify/App/blob/f95b99baddd8ac8a99499d5cad73029231cbcac8/src/libs/actions/Task.ts#L315-L318

Change it to below logic:

    if (!isCreatedUsingMarkdown) {
        clearOutTaskInfo();
        const reportId = !assigneeAccountID && ReportUtils.isGroupChat(parentReport) ? taskReportID : parentReportID;
        Navigation.dismissModal(reportId);
    }
huult commented 2 days ago

Proposal

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

After create a group task user is not redirected to task conversation

What is the root cause of that problem?

This issue happened because of this ticket, which states that after creating an IOU or task, the user should be redirected to the DM

https://github.com/Expensify/App/blob/f95b99baddd8ac8a99499d5cad73029231cbcac8/src/libs/actions/Task.ts#L317

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

When creating a task, we have shareDestination and assignee. If the assignee exists, we need to redirect the user to the share destination; otherwise, redirect to the task report

//.src/libs/actions/Task.ts#L304
-  Navigation.dismissModal(parentReportID);
+ Navigation.dismissModal(assigneeAccountID ? parentReportID : optimisticTaskReport.reportID);
https://github.com/user-attachments/assets/520d1514-713d-447a-8ad2-7dff2fe2a2e9