Skip to content

Conversation

@NikolausDemmel
Copy link

@NikolausDemmel NikolausDemmel commented Oct 20, 2025

Summary

Fixes #55785

When editing a user, if groups have display names different from their IDs (e.g., long group names that get hashed), the group selector was showing the group ID instead of the display name after page reload.

Root Cause

The data() function in UserRowMixin.js initialized userGroups with { id, name: id }, setting both the id and name fields to the group ID. While this works fine when the group ID and display name are the same, it breaks when they differ (e.g., when long group names get hashed).

Solution

Added a created() lifecycle hook that looks up the actual group names from the Vuex store ($store.state.users.groups) and initializes userGroups with the correct display names.

Notes

  • The fix has been tested manually and resolves the reported issue.
  • I also added a unit test that fails without the fix and passes with the fix.
  • Caveat: I have very little knowledge of the codebase and have to trust Claude Code's judgment that this fix is good and doesn't negatively affect any other parts, so this needs a good review from maintainers.

@NikolausDemmel NikolausDemmel marked this pull request as ready for review October 21, 2025 22:35
@NikolausDemmel NikolausDemmel force-pushed the fix-group-display-names-55785 branch from 6dd16fe to 4775a36 Compare October 21, 2025 23:01
@AndyScherzinger AndyScherzinger requested review from a team, artonge, sorbaugh and szaimen and removed request for a team October 28, 2025 21:02
@AndyScherzinger AndyScherzinger added the 3. to review Waiting for reviews label Oct 28, 2025
@szaimen szaimen requested review from susnux and removed request for szaimen October 31, 2025 13:11
@szaimen szaimen added this to the Nextcloud 33 milestone Oct 31, 2025
@szaimen szaimen added the bug label Oct 31, 2025
@susnux
Copy link
Contributor

susnux commented Oct 31, 2025

This PR should be against the master branch and then backported

When editing a user, if groups have display names different from their
IDs (e.g., long group names that get hashed), the group selector was
showing the group ID instead of the display name after page reload.

This happened because the `data()` function initialized `userGroups`
with `{ id, name: id }`, setting both fields to the group ID. The fix
adds a `created()` lifecycle hook that looks up the actual group names
from the Vuex store.

Fixes nextcloud#55785

Signed-off-by: Claude <[email protected]>

Co-Authored-By: Nikolaus Demmel <[email protected]>
Signed-off-by: Nikolaus Demmel <[email protected]>
Add Cypress E2E test to verify that group display names are shown
correctly in the user editor, even when the group ID differs from
the display name (e.g., when long group names get hashed).

The test creates a group with a very long name to trigger Nextcloud's
ID hashing behavior, assigns a user to that group, then verifies that
after a page reload the display name is shown instead of the hash ID.

Related to nextcloud#55785

Signed-off-by: Claude <[email protected]>

Co-Authored-By: Nikolaus Demmel <[email protected]>
Signed-off-by: Nikolaus Demmel <[email protected]>
Signed-off-by: Nikolaus Demmel <[email protected]>
Replace crypto-random-string import with Nextcloud's built-in randomString
utility to match the pattern used in other Cypress tests.

Also add missing testIsolation flag and cleanup hook to follow test
conventions used throughout the codebase.

Signed-off-by: Nikolaus Demmel <[email protected]>
@susnux
Copy link
Contributor

susnux commented Nov 2, 2025

/backport to stable32

@NikolausDemmel NikolausDemmel force-pushed the fix-group-display-names-55785 branch from c0dfbc6 to 469f4e6 Compare November 2, 2025 12:12
@NikolausDemmel
Copy link
Author

NikolausDemmel commented Nov 2, 2025

The Cypress tests fail with

Can not run cypress on forks

Same for performance tests:

Can not run performance tests on forks

Is there anything I can / should do?

@provokateurin
Copy link
Member

No, someone with access needs to create a copy of this PR to have the CI running and if that is green then this PR can be merged.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@kesselb
Copy link
Contributor

kesselb commented Nov 19, 2025

I think that #56524 (using the computed properties) is a bit cleaner.

@NikolausDemmel
Copy link
Author

Happy new year everyone! Friendly ping on this fix. Could we please get this PR approved / merged, or alternatively #56524 merged (and backported)? Thanks!

This was referenced Jan 7, 2026
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]: Group ID is displayed instead of group name when editing a user

7 participants