Skip to content

Fix display name of new users - #1682

Merged
mejo- merged 1 commit into
masterfrom
fix-display-name-of-new-users
Sep 10, 2024
Merged

Fix display name of new users#1682
mejo- merged 1 commit into
masterfrom
fix-display-name-of-new-users

Conversation

@danxuliu

@danxuliu danxuliu commented Sep 5, 2024

Copy link
Copy Markdown
Member

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

danxuliu commented Sep 5, 2024

Copy link
Copy Markdown
Member Author

/backport to stable30

@danxuliu

danxuliu commented Sep 5, 2024

Copy link
Copy Markdown
Member Author

/backport to stable29

@danxuliu

danxuliu commented Sep 5, 2024

Copy link
Copy Markdown
Member Author

/backport to stable28

@danxuliu

danxuliu commented Sep 5, 2024

Copy link
Copy Markdown
Member Author

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

danxuliu commented Sep 5, 2024

Copy link
Copy Markdown
Member Author

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

Alright, ready for review now.

@mejo- mejo- left a comment

Copy link
Copy Markdown
Member

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-

mejo- commented Sep 10, 2024

Copy link
Copy Markdown
Member

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

@mejo-

mejo- commented Sep 10, 2024

Copy link
Copy Markdown
Member

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