LuckPerms

LuckPerms

41.4k Downloads

LP editor causing odd meta saving glitch

bloodmc opened this issue ยท 1 comments

commented

Testing with latest LP 5.1.20

When I initially set any meta such as

griefdefender.pvp with value false

LP will always store it properly in JSON data like so

  "meta": [
    {
      "key": "griefdefender.pvp",
      "value": "true",
      "context": {
        "server": "global",
        "gd_claim_default": "global"
      }
    },

However, sometimes it will automatically get moved to the permissions section and be saved like below

  "permissions": [
    {
      "permission": "meta.griefdefender\\.pvp.false",
      "value": false,
      "context": {
        "server": "global",
        "gd_claim_default": "global"
      }
    },

I am not sure how to reliably reproduce this but when it gets moved to permissions, I've had issues unsetting it.

Relevant GD code
https://github.com/bloodmc/GriefDefender/blob/master/bukkit/src/main/java/com/griefdefender/provider/LuckPermsProvider.java#L741-L778

Update 1:

It seems running /lp editor will cause LP to move some meta into permissions in format
meta.option\\.key.value

Update 2:

I managed to finally reproduce reliably using only LP commands using JSON storage
Note: You have to make 2 changes in order to get /lp editor to cause a format change.

/lp user <playername> meta set metatest true
/lp user <playername> meta set metatest false
/lp editor   (should move to permissions in odd format)
/lp user <playername> meta set metatest true
Meta should be back in normal spot

What's odd about this is, it actually saves this change when /lp editor is executed as my JSON file gets updated.
Also, GD could still be updating meta via API while a server is using lp editor which wouldn't account for these moves.

commented

Thanks for the detailed report, this should be fixed now :)