Hey all, was hoping I could get some advice for an issue I'm running into.
I have a chat system where the player's 'chat format' is stored within the LuckPerms meta. So, for example, group default has a value at chat.format set to "<gray><name>: <white><message>" (this is a MiniMessage string using TagParsers to set name and message).
Every group has their own chat.format value, so I call UserManager#loadUser to look into a user's cached data for chat.format. As I understand it (and the jd's suggest), this will look into the group data as well. The loadUser method called every time a player sends a chat. So far, this has worked really well, but only 99% of the time.
At random intervals (as far as I can tell, I've been trying to nail this down for a while but never found a way to recreate it consistently), the loadUser method returns the user object like normal, but the cached data returns null for the data at chat.format. I'm not sure why this is happening (and I've confirmed it's LP because I've been printing out the result of chat.format and it is indeed returning null whenever this issue is triggered).
The full code for the method that loads their prefix format is here: https://gist.github.com/kadenscott/430ab80065da6e03b5b987fc8e6f0826
If anyone has any ideas, would love to hear them. (Maybe loadUser isn't the right method to use here?)
Running LuckPerms v5.4.21
This server is running Paper version git-Paper-333 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: 9fd870d)