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] Username in 'From username' on details page does not update dynamically #21419

Closed
1 of 6 tasks
kavimuru opened this issue Jun 23, 2023 · 29 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

Comments

@kavimuru
Copy link

kavimuru commented Jun 23, 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. Open the app and login with user A
  2. Open user B chat
  3. Send any message
  4. Hover and click on reply in thread
  5. Open the app on another device or incognito and login with user B
  6. Open user A chat and click on '1 Reply' of latest chat
  7. Click on chat text in header to open details page
  8. From user A device, change display name
  9. Observe in user B device that display name of user A is dynamically updated in 'From username' in thread header but it is not dynamically updated in details page in 'From username'

Expected Result:

App should dynamically update username in 'From username' on details page like it does on thread header

Actual Result:

App does not dynamically update username in 'From username' on details page

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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.31-2
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

from.username.not.dynamic.details.page.mp4
Recording.5116.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686810724004869

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016ad658d987efddd1
  • Upwork Job ID: 1674439924246831104
  • Last Price Increase: 2023-06-29
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 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

@dukenv0307
Copy link
Contributor

Proposal

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

BUG: username in 'From username' on details page does not update dynamically

What is the root cause of that problem?

When we change the display name, the BE will update personalDetail and personalDetailsList.
We are using useMemo for the getChatRoomSubtitle function

const chatRoomSubtitle = useMemo(() => ReportUtils.getChatRoomSubtitle(props.report), [props.report, policy]);

but in dependency, we don't have personalDetail or personalDetailsList so chatRoomSubtitle is not updated

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

We should add personalDetail to dependency of useMemo like this

    const chatRoomSubtitle = useMemo(() => ReportUtils.getChatRoomSubtitle(props.report), [props.report, policy, props.personalDetails]);

What alternative solutions did you explore? (Optional)

We also remove useMemo as we did in HeaderView

const subtitle = ReportUtils.getChatRoomSubtitle(reportHeaderData);

But it will make the component is re-render many times

@hoangzinh
Copy link
Contributor

Proposal

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

Username in 'From username' on details page does not update dynamically

What is the root cause of that problem?

  • In the function ReportUtils.getChatRoomSubtitle, If it's a thread from a chatReport, we will get roomName from displayName of parentReport

    App/src/libs/ReportUtils.js

    Lines 1066 to 1068 in 6183609

    const parentReport = lodashGet(allReports, [`${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID}`]);
    if (parentReport) {
    roomName = lodashGet(parentReport, 'displayName', '');
  • In ReportDetailsPage component, we call above function to get text to render for chatRoomSubtitle but currently we useMemo and the dependency list only props.report and policy
    const chatRoomSubtitle = useMemo(() => ReportUtils.getChatRoomSubtitle(props.report), [props.report, policy]);

We're missing parentReport.displayName in the dependency list above.

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

  • First of all, we need to get parentReport from Onyx here (by report.parentReportID)
  • Then we add parentReport.displayName to dependency list of useMemo above for chatRoomSubtitle

@isabelastisser
Copy link
Contributor

I'm heading OOO until July 5th, reassigning!

@isabelastisser isabelastisser removed their assignment Jun 23, 2023
@isabelastisser isabelastisser added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Jun 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

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

@melvin-bot

This comment was marked as duplicate.

@melvin-bot melvin-bot bot added the Overdue label Jun 26, 2023
@muttmuure
Copy link
Contributor

getting to this tomorrow

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jun 26, 2023
@muttmuure
Copy link
Contributor

Handling tomorrow

@conorpendergrast
Copy link
Contributor

Reproduced!

image

@conorpendergrast conorpendergrast added the External Added to denote the issue can be worked on by a contributor label Jun 29, 2023
@melvin-bot melvin-bot bot changed the title Username in 'From username' on details page does not update dynamically [$1000] Username in 'From username' on details page does not update dynamically Jun 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

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

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

melvin-bot bot commented Jun 29, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

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

@absolutezero13
Copy link

Proposal

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

Username in 'From username' on details page does not update dynamically

What is the root cause of that problem?

In ReportDetailsPage, we don't have correct dependencies in useMemo for chatRoomSubtitle.

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

We should add personalDetails from props as dependency.
Screenshot 2023-06-29 at 19 27 02

What alternative solutions did you explore? (Optional)

Or we can remove useMemo entirely.

@mallenexpensify
Copy link
Contributor

@allroundexperts
Copy link
Contributor

Replied in #21622 as instructed.

@allroundexperts
Copy link
Contributor

Thanks for the proposals everyone!

All of you pointed out a similar root cause. In this case, I'll go on with @dukenv0307's alternate solution. I think using useMemo here is an overkill. As clearly stated in React docs as well, useMemo should be used with precaution because some times, the time needed to check whether a dependency has changed is more than simply re-calculating the new value.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jun 30, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Jul 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 3, 2023

@cead22, @conorpendergrast, @allroundexperts Whoops! This issue is 2 days overdue. Let's get this updated quick!

@conorpendergrast
Copy link
Contributor

Carlos will review this - he's not working 100% this week and I saw him firefighting too

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

melvin-bot bot commented Jul 5, 2023

📣 @allroundexperts 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

📣 @dukenv0307 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

📣 @dhanashree! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

The BZ member will need to manually hire dhanashree for the Reporter role. Please store your Upwork details and apply to our Upwork job so this process is automatic in the future!

@dukenv0307
Copy link
Contributor

The "From username" is removed from the detail page so we don't need to fix this anymore.
Let me know if any concerns

Screenshot 2023-07-06 at 10 08 50

@cead22
Copy link
Contributor

cead22 commented Jul 6, 2023

All yours @conorpendergrast

@melvin-bot
Copy link

melvin-bot bot commented Jul 7, 2023

@cead22 @conorpendergrast @allroundexperts @dukenv0307 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Jul 10, 2023
@conorpendergrast
Copy link
Contributor

conorpendergrast commented Jul 10, 2023

I agree we can now close this issue.

I checked PRs and issues and wasn't able to find whether this was a planned change from before this bug was reported, or not. If it was planned, we wouldn't tend to pay the bug bounty.

Given I wasn't able to find this, I'll create a contract for the bug bounty now

@melvin-bot melvin-bot bot removed the Overdue label Jul 10, 2023
@conorpendergrast
Copy link
Contributor

Done, paid and contract ended!

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
Projects
None yet
Development

No branches or pull requests

10 participants