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

Fix display name of new users #1682

Merged
merged 1 commit into from
Sep 10, 2024
Merged

Fix display name of new users #1682

merged 1 commit into from
Sep 10, 2024

Conversation

danxuliu
Copy link
Member

@danxuliu danxuliu commented Sep 5, 2024

Fixes nextcloud/contacts#3646

Although since #1648 the display name of users is updated in a circle when it is changed in the user settings, the new display name was not shown if the user was then added to a circle; when the display name is changed it needs to be updated both for the circles and the members, similarly to how it is done when updating the display name in the MaintenanceService.

Originally this pull request had an additional commit to set the display name of the associated member based on the IUser API instead of the account data when a user was created; this was done on the basis that the user was updated after being created due to the avatar being generated, but that it was just a happy coincidence and the user should be properly set up from the beginning. But that was wrong 🤦 When the UserCreated event is triggered the user does not even have a display name set, and the UserChanged event is then triggered not only when the avatar is generated, but when the display name is actually set in the newly created user. Due to that the extra commit was dropped.

How to test (scenario 1)

  • Create a user with a display name
  • Open the Contacts app
  • Create a circle
  • Add the user

Result with this pull request

The display name of the user is shown in the circle

Result without this pull request

The id of the user is shown in the circle

How to test (scenario 2)

  • Create a user
  • Set a display name for the user
  • Open the Contacts app
  • Create a circle
  • Add the user

Result with this pull request

The display name of the user is shown in the circle

Result without this pull request

The id of the user is shown in the circle

@danxuliu
Copy link
Member Author

danxuliu commented Sep 5, 2024

/backport to stable30

@danxuliu
Copy link
Member Author

danxuliu commented Sep 5, 2024

/backport to stable29

@danxuliu
Copy link
Member Author

danxuliu commented Sep 5, 2024

/backport to stable28

@danxuliu
Copy link
Member Author

danxuliu commented Sep 5, 2024

Wait, I messed it 🤦 Back to Developing, not ready for review yet.

Although the display name of users is updated in a circle when it is
changed in the user settings, the new display name was not shown if the
user was then added to a circle due to a missing update of the member
and, therefore, the cached name.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu force-pushed the fix-display-name-of-new-users branch from 0ffd9bc to 3903094 Compare September 5, 2024 11:36
@danxuliu
Copy link
Member Author

danxuliu commented Sep 5, 2024

Wait, I messed it 🤦 Back to Developing, not ready for review yet.

Alright, ready for review now.

Copy link
Member

@mejo- mejo- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice, works well. Thanks @danxuliu ❤️

@mejo-
Copy link
Member

mejo- commented Sep 10, 2024

Old accounts don't get updated by occ circles:sync though, let me look into that.

@mejo-
Copy link
Member

mejo- commented Sep 10, 2024

Old accounts don't get updated by occ circles:sync though, let me look into that.

Well, that's a separate issue and can be tackled separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Members of circles are shown by user id instead of display name
2 participants