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-09] [$500] Task - Task assignee profile opens when clicking on the header of task report #30182

Closed
6 tasks done
lanitochka17 opened this issue Oct 23, 2023 · 32 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

@lanitochka17
Copy link

lanitochka17 commented Oct 23, 2023

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: 1.3.89-4

Reproducible in staging?: Yes

Reproducible in production?: Yes

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: Applause - Internal Team

Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to any chat > + > Assign task
  3. Create a task with no assignee
  4. On the task report, click on the report header
  5. Verify that the task details page shows up
  6. Repeat Step 1 to 3 with task with an assignee

Expected Result:

Task details modal opens when clicking on the report header of the task with assignee

Actual Result:

Task assignee profile opens instead of task details modal

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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Bug6247499_1698072098279.20231023_221048.mp4
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01852a4aad8299505f
  • Upwork Job ID: 1716479601614000128
  • Last Price Increase: 2023-10-23
@lanitochka17 lanitochka17 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 23, 2023
@melvin-bot melvin-bot bot changed the title Task - Task assignee profile opens when clicking on the header of task report [$500] Task - Task assignee profile opens when clicking on the header of task report Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

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

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

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

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

@shubham1206agra
Copy link
Contributor

I am able to repro this.

@FitseTLT
Copy link
Contributor

FitseTLT commented Oct 23, 2023

Proposal

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

Task assignee profile opens when clicking on task report header

What is the root cause of that problem?

Because of this line:

App/src/libs/ReportUtils.js

Lines 2074 to 2077 in 844b3b9

if (isDM(report) && participantAccountIDs.length === 1) {
Navigation.navigate(ROUTES.PROFILE.getRoute(participantAccountIDs[0]));
return;
}

It navigates to participant or assignee detail when the task has an assignee

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

We should change those lines to display the task detail whether there is participant( assignee) is there or not
Change

App/src/libs/ReportUtils.js

Lines 2074 to 2077 in 844b3b9

if (isDM(report) && participantAccountIDs.length === 1) {
Navigation.navigate(ROUTES.PROFILE.getRoute(participantAccountIDs[0]));
return;
}

to
`

function navigateToDetailsPage(report) {
const participantAccountIDs = lodashGet(report, 'participantAccountIDs', []);
const type = lodashGet(report, 'type', '');

if (isDM(report) && participantAccountIDs.length === 1 && type !== 'task') {
    Navigation.navigate(ROUTES.PROFILE.getRoute(participantAccountIDs[0]));
    return;
}
Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID));

}

`

What alternative solutions did you explore? (Optional)

@alitoshmatov
Copy link
Contributor

Proposal

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

Task - Task assignee profile opens when clicking on the header of task report

What is the root cause of that problem?

This condition is not sufficient since isDM function is returning true for task reports also

App/src/libs/ReportUtils.js

Lines 2074 to 2077 in 844b3b9

if (isDM(report) && participantAccountIDs.length === 1) {
Navigation.navigate(ROUTES.PROFILE.getRoute(participantAccountIDs[0]));
return;
}

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

We should update the condition so that it takes task reports into consideration, like this:

isDM(report) && participantAccountIDs.length === 1 && !isTaskReport(report)

What alternative solutions did you explore? (Optional)

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Oct 24, 2023

@FitseTLT @alitoshmatov Thank you for your proposals.
Both have very similar proposals but need more reasoning in their RCA.
Can you both elaborate on why this happens when we only assign during creating a task but not on the task where we have no assignee while creating the task?
And please also post a video too

@bernhardoj
Copy link
Contributor

Proposal

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

Pressing the task header on a task report only with an assignee will open the assignee profile instead of the task report details page.

What is the root cause of that problem?

Pressing the header will call navigateToDetailsPage. It will open a profile page only if isDM is true and only 1 participant.

App/src/libs/ReportUtils.js

Lines 2125 to 2133 in d282473

function navigateToDetailsPage(report) {
const participantAccountIDs = lodashGet(report, 'participantAccountIDs', []);
if (isDM(report) && participantAccountIDs.length === 1) {
Navigation.navigate(ROUTES.PROFILE.getRoute(participantAccountIDs[0]));
return;
}
Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID));
}

isDM will return true if the chatType is an empty string. The isDM function is actually misleading because there are many types of reports without chatType, for example, thread.

In the case of a task report, the chatType is an empty string (so isDM is true) and the participant is the assignee itself, so the user will be navigated to the assignee profile page.

If the assignee is empty, the participant is empty.

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

We should replace the if condition with isOneOnOneChat which handles the personal chat correctly.

if (isOneOnOneChat(report)) {
    Navigation.navigate(ROUTES.PROFILE.getRoute(participantAccountIDs[0]));
}

@alitoshmatov
Copy link
Contributor

alitoshmatov commented Oct 24, 2023

@shubham1206agra Looks like there is another issue with updating assignee of the task.

function editTaskAssigneeAndNavigate(report, ownerAccountID, assigneeEmail, assigneeAccountID = 0, assigneeChatReport = null) {

In editTaskAssigneeAndNavigate we are not updating participantAccountIDs with optimistic data, But we updating it when creating new task
participantAccountIDs: assigneeAccountID && assigneeAccountID !== ownerAccountID ? [assigneeAccountID] : [],

Thus when we edit task assignee this field is not getting updated resulting in the above error. Also this is causing issue where when we create a task with a assignee and then change assignee, clicking on the header results in showing wrong assignee(below video)

Screen.Recording.2023-10-24.at.10.23.11.mov

This looks like separate issue, but if we want to fix this here we can achieve it by adding this line:

to optimistic data here:

managerID: assigneeAccountID || report.managerID,
managerEmail: assigneeEmail || report.managerEmail,

It looks like it also requires backend changes since backend also is not sending updated participantAccountIDs

@FitseTLT
Copy link
Contributor

@FitseTLT @alitoshmatov Thank you for your proposals. Both have very similar proposals but need more reasoning in their RCA. Can you both elaborate on why this happens when we only assign during creating a task but not on the task where we have no assignee while creating the task? And please also post a video too

App/src/libs/ReportUtils.js

Lines 2071 to 2079 in 844b3b9

function navigateToDetailsPage(report) {
const participantAccountIDs = lodashGet(report, 'participantAccountIDs', []);
if (isDM(report) && participantAccountIDs.length === 1) {
Navigation.navigate(ROUTES.PROFILE.getRoute(participantAccountIDs[0]));
return;
}
Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID));
}

Ok @shubham1206agra as you can see above in the code when there is no assignee or even if you assigned yourself on the task participantAccountIDs.length === 1 will be false so the details page of the task report will be navigated but when there is an assignee (not the creator of the task) participantAccountIDs.length === 1 will be true and it will navigate to the participants or assignee detail page. Also tried to include a debugging video. Thanks!

18.New.Expensify.mp4

@shubham1206agra
Copy link
Contributor

@bernhardoj Can you put a video to confirm your solution works in every case?

@bernhardoj
Copy link
Contributor

bernhardoj commented Oct 26, 2023

Screen.Recording.2023-10-26.at.13.12.01.mov

It will also fix the issue with the thread.

Screen.Recording.2023-10-26.at.13.14.31.mov

@shubham1206agra
Copy link
Contributor

Since @bernhardoj's proposal came first after my comment for detailed RCA and it fixes more wide problems.

Let's go with this proposal then.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 26, 2023
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 26, 2023
@bernhardoj
Copy link
Contributor

PR is ready

cc: @shubham1206agra

@alexpensify
Copy link
Contributor

@shubham1206agra - bumping, can you please review this PR? Thanks!

@alexpensify
Copy link
Contributor

Looks like the PR is merged, waiting for automation here.

@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 2, 2023
@melvin-bot melvin-bot bot changed the title [$500] Task - Task assignee profile opens when clicking on the header of task report [HOLD for payment 2023-11-09] [$500] Task - Task assignee profile opens when clicking on the header of task report Nov 2, 2023
Copy link

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

melvin-bot bot commented Nov 2, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.94-2 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-09. 🎊

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

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

@alexpensify
Copy link
Contributor

@shubham1206agra - to prepare for the payment date, can you please complete the checklist? Thanks!

@alexpensify
Copy link
Contributor

@shubham1206agra bumping again, I'm trying to get ready for the payment date. Thanks!

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Nov 7, 2023

BugZero Checklist:

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

alexpensify commented Nov 9, 2023

Here is the payment summary:

  • External issue reporter - N/A
  • Contributor that fixed the issue - @bernhardoj $500
  • Contributor+ that helped on the issue and/or PR - @shubham1206agra $500

Upwork Job: https://www.upwork.com/jobs/~01852a4aad8299505f

*If applicable, the bonuses will be applied on the final payment

Extra Notes regarding payment: This one was before the pre-urgency bonus change, and was merged in 3 business days.

@alexpensify
Copy link
Contributor

@bernhardoj and @shubham1206agra - can you please apply to the job here:

https://www.upwork.com/jobs/~01852a4aad8299505f

It looks like the automation didn't assign it to you. Thanks, I'll complete the required steps tomorrow.

@bernhardoj
Copy link
Contributor

Applied

@alexpensify
Copy link
Contributor

@bernhardoj and @shubham1206agra - I've started the process in Upwork. Please accept and I can apply the bonuses and close this GH. Thanks!

@alexpensify
Copy link
Contributor

After reviewing the payment summary again, I confirmed with the team that the PR for this one was created after the announcement (on October 24) related to the discontinuation of the urgency bonus. The conversation is here:

https://expensify.slack.com/archives/C01GTK53T8Q/p1698191269281379

My apology for not catching this sooner, but the base payment will remain the same.

@alexpensify
Copy link
Contributor

@shubham1206agra has been paid in Upwork. @bernhardoj needs to accept and then we can pay in Upwork. Thanks!

@bernhardoj
Copy link
Contributor

Accepted!

@alexpensify
Copy link
Contributor

alexpensify commented Nov 10, 2023

Perfect, everyone has been paid via Upwork!

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