Wrong primary group shown in /lp user <user> info
Closed this issue ยท 8 comments
We have multiple groups and it seems its alphabetically determining what to show as the primary group in the user info
command. For example, I have myself with parent groups admin
and default
, and according to the yaml file my primary group is default
, yet in user info
it shows admin
. If I do user parent switchprimarygroup
to default
, it (correctly) says that I already have that set as the primary group. If I remove the admin
group as a parent, then the user info
command correctly shows default
as primary group.
Then, I tested further to prove this is some alphabetical sorting related bug of some kind: I added admin
back as a parent but then I also created an additional group called aaatest
and added it as a parent group, and indeed, the user info
command then shows aaatest
as the primary group (instead of admin
or default
) while the yaml file still has it set to default
. I did the same with a group called test
and because its lower in the alphabet it did not show as the primary group in the user info
command.
So all in all it seems to only be a visual/textual output bug in the user info
command and hopefully nothing more than that.
Versions in use are: Spigot 1.15.1 and LuckPerms 5.0.50
Have you given the groups weight?
https://github.com/lucko/LuckPerms/wiki/Command-Usage:-Group#lp-group-group-setweight-weight
A higher weight means the group is more important than an inherited group of lower weight
Thank you for your suggestion. I added weights to the groups and that indeed "fixed" the issue.
However, upon inspecting my config.yml
it turns out primary-group-calculation: parents-by-weight
was set instead of primary-group-calculation: stored
. I don't remember having set this, maybe it was the default at some point in time. Setting it to stored
fixed the issue without needing to give weights to the groups.
primary-group-calculation: parents-by-weight
has been the default for over 2 years.
Oh, well the first paragraph here made me think it was different at some point (e.g. determined automatically based on server type detected at run time).