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

[$1000] Web - Clicking on Avatar in Header of Task Detail page takes to wrong user details #23579

Closed
1 of 6 tasks
kbecciv opened this issue Jul 25, 2023 · 14 comments
Closed
1 of 6 tasks
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

@kbecciv
Copy link

kbecciv commented Jul 25, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Create a task with assignee
  2. Go to task page
  3. Wait till the time in the bottom shows up
  4. Click on User in Header of Task details page

Expected Result:

There are two possibilities:
It should show the details of the task creator

Actual Result:

Wrong user in Header and User Details page

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.45.3
Reproducible in staging?: y
Reproducible in production?: y
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
Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-07-21.at.2.00.52.PM.mov

Expensify/Expensify Issue URL:
Issue reported by: @BhuvaneshPatil
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689928645869329

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ccc9b0b61fc1bf49
  • Upwork Job ID: 1684047964217954304
  • Last Price Increase: 2023-07-26
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 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

@kbecciv
Copy link
Author

kbecciv commented Jul 25, 2023

Proposal by: @BhuvaneshPatil
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689928645869329

Proposal

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

Clicking on header of task report opens assignee page instead of members/details page

What is the root cause of that problem?

When we click on header - navigateToDetailsPage function is called.

<PressableWithoutFeedback
onPress={() => ReportUtils.navigateToDetailsPage(props.report)}
style={[styles.flexRow, styles.alignItemsCenter, styles.flex1]}
disabled={isTaskReport && !ReportUtils.isOpenTaskReport(props.report)}
accessibilityLabel={title}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
>

And this function -

App/src/libs/ReportUtils.js

Lines 1269 to 1281 in b7d17e0

function navigateToDetailsPage(report) {
const participantAccountIDs = lodashGet(report, 'participantAccountIDs', []);
if (isChatRoom(report) || isPolicyExpenseChat(report) || isChatThread(report)) {
Navigation.navigate(ROUTES.getReportDetailsRoute(report.reportID));
return;
}
if (participantAccountIDs.length === 1) {
Navigation.navigate(ROUTES.getProfileRoute(participantAccountIDs[0]));
return;
}
Navigation.navigate(ROUTES.getReportParticipantsRoute(report.reportID));
}

For task which has assignee, there is only one accountID in participantAccountIDs (which is task assignee), that's why we are opening the assignee profile page.

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

The solution depends on what page do we want to open

  1. If we want to open details page
    Then we shall add the condition here -

    if (isChatRoom(report) || isPolicyExpenseChat(report) || isChatThread(report) || isTaskReport(report)) {
    Navigation.navigate(ROUTES.getReportDetailsRoute(report.reportID));
    return;
    }

  2. If we want to open the members page -
    Then there are two approaches for this -

    • Add the following condition that check if current report is task report or not and based on that navigates to required page

      if(isTaskReport(report)){
      Navigation.navigate(ROUTES.getReportParticipantsRoute(report.reportID));
      return;
      }

    • Add condition while we are redirecting to user details page to check if the report is task report or not

      if (participantAccountIDs.length === 1 && !isTaskReport(report)) {
      Navigation.navigate(ROUTES.getProfileRoute(participantAccountIDs[0]));
      return;
      }

What alternative solutions did you explore? (Optional)

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Jul 25, 2023

Expanding on - #23579 (comment)

Proposal

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

Web - Clicking on Avatar in Header of Task Detail page takes to wrong user details

What is the root cause of that problem?

When we click on header - navigateToDetailsPage function is called. And in case of task that is assigned to someone.
participantAccountIDs has only one id. and we are take to profile details of task assignee profile details page.

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

as mentioned by @thienlnam here - https://expensify.slack.com/archives/C049HHMV9SM/p1690311552613889?thread_ts=1689928645.869329&cid=C049HHMV9SM

Clicking on task header should take us to profile details of creator. To adjust for this behaviour -
we can modify this method(navigateToDetailsPage) as following -

  • We add the check if current report is task or not. and based on that redirect user to creator's profile page.
    We can get the creatorID using ownerAccountID field.
    if(isTaskReport(report)){
        Navigation.navigate(ROUTES.getProfileRoute(report.ownerAccountID));
        return;
    }

What alternative solutions did you explore? (Optional)

@JmillsExpensify
Copy link

Able to reproduce this one. Given that the task creator is the avatar that appears in the header, I think that's the one we should be showing.

@JmillsExpensify JmillsExpensify added the External Added to denote the issue can be worked on by a contributor label Jul 26, 2023
@melvin-bot melvin-bot bot changed the title Web - Clicking on Avatar in Header of Task Detail page takes to wrong user details [$1000] Web - Clicking on Avatar in Header of Task Detail page takes to wrong user details Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

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

melvin-bot bot commented Jul 26, 2023

Current assignee @JmillsExpensify is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

@Nodebrute
Copy link
Contributor

Nodebrute commented Jul 26, 2023

dupe of #23296 and #22498. @jasperhuangg will be taking care of this #23296 (comment).

@JmillsExpensify
Copy link

I think that second one is a closer replica. Thanks for flagging. I'll close though Jasper, please re-open if you disagree.

@JmillsExpensify
Copy link

Further for clarity, since this is a duplicate report, no payout is issued for reporting.

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Jul 26, 2023

@Nodebrute. I have mentioned the root cause for #23296 in slack conversation. So they are not dupes.

The PR that was going to fix -#22498, has been merged and it's still reproducible.

@Nodebrute
Copy link
Contributor

Nodebrute commented Jul 26, 2023

@BhuvaneshPatil the issue related to task header has been reported multiple times and this bug was caught during the PR of that issue. where they decided to hold it #22586 (comment).

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Aug 7, 2023

Updated proposal -

Dupe of this issue that was reported after this issue, proposal on that issue - #24144 (comment)

Proposal

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

It must show the detail of the user's profile that assigns the task

What is the root cause of that problem?

As decided here in slack - https://expensify.slack.com/archives/C01GTK53T8Q/p1691426870537099?thread_ts=1691334974.136469&cid=C01GTK53T8Q

We should show the task title (the one that appears in header below the avatar, and avatar will be of task creator)

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

We are disabling showing shouldUseFullTitle here -

<DisplayNames
fullTitle={ReportUtils.getReportName(props.report)}
displayNamesWithTooltips={displayNamesWithTooltips}
tooltipEnabled
numberOfLines={isChatRoom ? 0 : 1}
textStyles={[styles.textHeadline, styles.textAlignCenter, isChatRoom ? undefined : styles.pre]}
shouldUseFullTitle={shouldUseFullTitle}
/>

For that value we use -

const shouldDisableSettings = useMemo(() => ReportUtils.shouldDisableSettings(props.report), [props.report]);
const shouldUseFullTitle = !shouldDisableSettings;

We shall change - shouldUseFullTitle to something like below -

const shouldUseFullTitle = !shouldDisableSettings || ReportUtils.isTaskReport(props.report);

It will allow to show full title in case we are opening a task report.

If we want to show the settings option as well -
we can change shouldDisableSettings in ReportUtils -

function shouldDisableSettings(report) {
    return !isPolicyExpenseChat(report) && !isChatRoom(report) && !isChatThread(report) && !isTaskReport(report);
}

What alternative solutions did you explore? (Optional)

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