LuckPerms

LuckPerms

905k Downloads

Setting group via API on velocity does not sync stuff with backend servers

MatinHQ opened this issue · 1 comments

commented

Description

 val lpPlayer = StaffDuty.luckPermsAPI.userManager.loadUser(executor.uniqueId)
 val lpGroup = StaffDuty.luckPermsAPI.groupManager.getGroup(dbPlayer[DBPlayer.rank]) ?: return

        lpPlayer.thenAccept { lpUser ->
            lpUser.data().remove(Node.builder("staffduty.toggle").build())
            lpUser.data().add(InheritanceNode.builder(lpGroup).build())

            StaffDuty.luckPermsAPI.userManager.saveUser(lpUser)
        }

I have a command that takes a player's group and assigns it back to the duty system. The problem is that, for example, when a moderator goes on duty and executes the command, it changes their rank to default which works fine.

However, when I execute /papi parse playerName %luckperms_highest_group_weight on the backend server the user is on, it still shows their previous group weight.

I thought the issue might be with our messaging service method, which was using a plugin message. I changed it to Redis, but the problem persists. Then I tried using /lpv user playerName parent set default to see if the same issue happens, and found that it's fixed, so it’s definitely something wrong with the API. Executing /lp networksync on the backend server will also resync the group weight.

Reproduction Steps

Use API calls velocity and set group of player you will see it will not update some stuff such as group weight on backend server

Expected Behaviour

It should update group weight and other stuff

Server Details

Velocity-3.4.0-#450

LuckPerms Version

v5.4.146

Logs and Configs

No response

Extra Details

No response

commented

Solved, after modifying user we have to sync it using luckperms messaging service