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] Workspace - User name is not updated dynamically in Workspace Invite Member page #22175

Closed
6 tasks done
lanitochka17 opened this issue Jul 4, 2023 · 11 comments
Closed
6 tasks done
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

@lanitochka17
Copy link

lanitochka17 commented Jul 4, 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!


Issue found when executing PR #21700

Action Performed:

  1. Go to staging.new.expensify.com
  2. As User A, go to Settings > Workspace > Members > Invite > Enter User B's address > Select User B
  3. As User B, change profile name

Expected Result:

B's name is changed correctly in A

Actual Result:

B's name is not updated in A

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.36.2

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

Notes/Photos/Videos: Any additional supporting documentation

Bug6115730_bandicam_2023-07-04_17-05-16-341.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

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

melvin-bot bot commented Jul 4, 2023

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

@melvin-bot
Copy link

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

@s-alves10
Copy link
Contributor

This isn't reproducible.

@melvin-bot melvin-bot bot added the Overdue label Jul 6, 2023
@sonialiap sonialiap added the External Added to denote the issue can be worked on by a contributor label Jul 6, 2023
@sonialiap
Copy link
Contributor

I can reproduce. Triaging to external

Screen.Recording.2023-07-06.at.11.21.04.PM.mov

@melvin-bot melvin-bot bot changed the title Workspace - User name is not updated dynamically in Workspace Invite Member page [$1000] Workspace - User name is not updated dynamically in Workspace Invite Member page Jul 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

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

@melvin-bot melvin-bot bot added Help Wanted Apply this label when an issue is open to proposals by contributors and removed Overdue labels Jul 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

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

@rayane-djouah
Copy link
Contributor

rayane-djouah commented Jul 9, 2023

Proposal

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

The WorkspaceInvitePage component in our application is not updating (re-rendering) as expected when changes are made to the personalDetails prop. This leads to outdated information being displayed on the page, which impacts the usability and user experience of our application.

What is the root cause of that problem?

The root cause of the problem is that the equality check in our componentDidUpdate() lifecycle method only compares object references rather than the actual values contained within those objects. In JavaScript, if two variables are referencing different objects, even though these objects contain identical data, they will be considered unequal. This means that when the personalDetails prop changes, unless a new object is created, the component won't recognize the change and thus won't re-render.

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

To solve the problem, we should update our comparison logic to not only check for reference changes but also for changes in the actual values of the objects.

Current comparison logic:

componentDidUpdate(prevProps) {
if (!_.isEqual(prevProps.personalDetails, this.props.personalDetails) || !_.isEqual(prevProps.policyMembers, this.props.policyMembers)) {
this.updateOptionsWithSearchTerm(this.state.searchTerm);
}

Here's the code snippet for the proposed solution:

    const didPersonalDetailsChange = prevProps.personalDetails !== this.props.personalDetails 
                                     || !_.isEqual(prevProps.personalDetails, this.props.personalDetails);

    const didPolicyMembersChange = prevProps.policyMembers !== this.props.policyMembers 
                                   || !_.isEqual(prevProps.policyMembers, this.props.policyMembers);

    if (didPersonalDetailsChange || didPolicyMembersChange) {
        this.updateOptionsWithSearchTerm(this.state.searchTerm);
    }

Result:

result.mp4

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jul 9, 2023
@rayane-djouah
Copy link
Contributor

@sonialiap @mollfpr could you review my proposal please?

@mollfpr
Copy link
Contributor

mollfpr commented Jul 10, 2023

I couldn't reproduce this with the OP step. @sonialiap I couldn't access your video attachment to see the step.

Screen.Recording.2023-07-10.at.10.37.17.mov

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jul 10, 2023
@sonialiap
Copy link
Contributor

I can't reproduce any longer. I'm guessing this was fixed by another PR

Screen.Recording.2023-07-13.at.3.58.59.PM.mov

@melvin-bot melvin-bot bot removed the Overdue label Jul 13, 2023
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