Skip to content

Show group display name when the group object is not loaded yet#56533

Open
kesselb wants to merge 2 commits into
masterfrom
bug/56532/display-in-users-list
Open

Show group display name when the group object is not loaded yet#56533
kesselb wants to merge 2 commits into
masterfrom
bug/56532/display-in-users-list

Conversation

@kesselb

@kesselb kesselb commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

Summary

We are fetching the first 25 groups when opening the users list. If a user in that list has a group assigned that was not part of the first 25 groups, then we don't have the displayname.

Until:

  • The user opens the edit mode (then all groups are lazy loaded)
  • The user scrolls in the group view to load the next batch of groups

STR

Preparation:

  • Have more than 25 groups.
  • Assign group number 26, 27, etc to a user.
Helper script
for i in {1..30}; do
  occ group:add --display-name "Test Group $i" group$i
done

for i in {31..35}; do
  occ group:add --display-name "Test Group $i" group$i
  occ group:adduser group$i alice
  occ group:adduser group$i bob
  occ group:adduser group$i fry
  occ group:adduser group$i hermes
  occ group:adduser group$i bender
  occ group:adduser group$i professor
done

Case 1:

  • Open the user management
  • Reload to ensure the local state is clear
  • See that some of the groups are not using the display name, but the group id.
  • Scroll the list of groups on the left => the group id is replaced by the display name
  • This PR: List of groups is using the displayname

Case 2:

  • Open the user management
  • Reload to ensure the local state is clear
  • Open the edit view for a user where the disply name is missing
  • See that the list of groups is incomplete
  • This PR: List of groups is complete

Case 3:

  • Open the user management
  • Create a new group occ group:add --display-name "Test Group Subadmin" group_subadmin
  • Assign "group_subadmin" to a user
  • Reload to ensure the local state is clear
  • See the in the userlist the subadmin column is empty
  • Also in the edit view it looks like the user has no subadmin group
  • This PR: Subadmin groups are shown in list and edit

Case 4:

  • Open the user management
  • Open the user list for a group
  • Reload to ensure the local state is clear
  • See that some of the groups are not using the display name, but the group id.
  • Scroll the list of groups on the left => the group id is replaced by the display name
  • This PR: List of groups is using the displayname

Checklist

@kesselb kesselb self-assigned this Nov 19, 2025
@kesselb kesselb added bug 3. to review Waiting for reviews labels Nov 19, 2025
@kesselb kesselb added this to the Nextcloud 33 milestone Nov 19, 2025
@kesselb kesselb added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Nov 19, 2025
@kesselb

kesselb commented Nov 19, 2025

Copy link
Copy Markdown
Contributor Author

cc @artonge @come-nc @susnux @benjaminfrueh for early feedback as you were involved in the other pr's.

@blizzz blizzz modified the milestones: Nextcloud 33, Nextcloud 34 Feb 16, 2026
@kesselb kesselb force-pushed the bug/56532/display-in-users-list branch from 3d8a69b to ace2275 Compare May 27, 2026 16:35
@kesselb kesselb requested a review from Copilot May 27, 2026 16:36
@kesselb kesselb changed the title Also show group display name when the group object is not loaded yet Show group display name when the group object is not loaded yet May 27, 2026
@kesselb kesselb marked this pull request as ready for review May 27, 2026 16:49
@kesselb kesselb requested review from a team as code owners May 27, 2026 16:49
@kesselb kesselb requested review from CarlSchwan, nfebe, pringelmann, provokateurin, sorbaugh and susnux and removed request for a team May 27, 2026 16:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@artonge artonge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see that we could instead provide the group mapping in another property in the response:

return new DataResponse([
'users' => $usersDetails
]);

So the endpoints could contain:

{
	"users": [
		{
			"id": "user1",
			"group": ["group1"]
		},
		{
			"id": "user2",
			"group": ["group1", "group2"]
		}
	],
	"groups": [
		{
			"id": "group1",
			"display_name": "Group 1"
		},
		{
			"id": "group2",
			"display_name": "Group 2"
		}
	]
}

Compare to the current proposal, in which the mapping is contained multiple time in each user object.

What do you think?

@kesselb kesselb force-pushed the bug/56532/display-in-users-list branch from adb0fb5 to 2fcfd0f Compare June 2, 2026 13:11

@artonge artonge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, only one question

Comment thread apps/settings/src/components/Users/userFormUtils.ts Outdated
This was referenced Jun 5, 2026
@susnux susnux removed this from the Nextcloud 34.0.1 milestone Jun 9, 2026
@kesselb kesselb force-pushed the bug/56532/display-in-users-list branch 2 times, most recently from d4f2d7e to 7a21aa5 Compare July 1, 2026 15:38
@kesselb

kesselb commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

/backport to stable34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 3 comments.

Comment thread apps/settings/src/store/users.js
Comment thread apps/settings/src/store/users.js
Comment thread apps/provisioning_api/lib/Controller/UsersController.php Outdated
@kesselb kesselb requested a review from skjnldsv as a code owner July 2, 2026 15:25
@kesselb kesselb force-pushed the bug/56532/display-in-users-list branch from 1e84275 to b726587 Compare July 2, 2026 15:26
@kesselb

kesselb commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for your input!

I've marked the conversation about addGroup as resolved. Copilot flagged that this change could add an incomplete group object to the store. The previous implementation of addGroup would not update a group with the correct usercount once it was later fetched with full details. That's addressed now by updating an existing group instead, as suggested.

On master, groups assigned to a user (part of the user response) that aren't yet known to the frontend store aren't shown in the user list and edit dialog. This is fixed by sending the id => displayname mapping along with the user list response and adding those groups to the store. However, that group object is incomplete so the count is only shown once the user scrolls down the group list (which loads the full group details).

I'd hope this is an acceptable trade-off: not seeing the group at all vs. seeing the group with the right name but a missing count. This was originally reported against an older version where the group id was shown but only the display name was missing; a recent change made that worse.

Looking forward to your feedback.

@kesselb kesselb force-pushed the bug/56532/display-in-users-list branch from b726587 to 02b2e84 Compare July 2, 2026 15:46
@kesselb kesselb added 3. to review Waiting for reviews AI assisted and removed 2. developing Work in progress labels Jul 2, 2026
@kesselb kesselb force-pushed the bug/56532/display-in-users-list branch from 02b2e84 to 961afd4 Compare July 2, 2026 16:22
kesselb added 2 commits July 3, 2026 10:36
By default only 25 group objects are loaded. If a user is assigend to a
group, that isn't loaded yet, we only show the gid instead of the
displayname.

Assisted-by: Copilot:gpt-5.4
Assisted-by: ClaudeCode:claude-sonnet-5

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb kesselb force-pushed the bug/56532/display-in-users-list branch from 961afd4 to 56c7806 Compare July 3, 2026 08:37
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.

[Bug]: Display name of group not shown until group object is lazy loaded in user management

7 participants