PAR-150
Bug: General caching issues with usernames
Symptom
Staff can't run /gov payout, /fine issue, or /bal against certain players (examples: Dodrio3, dearev) — the command reports the target as unknown/unresolvable, even though the account exists.
Root cause (grounded)
All three resolve a username via cache-only Bukkit.getOfflinePlayerIfCached(name), which returns null whenever the player isn't currently in the server usercache:
/gov payout→GovCommand.doExternalPayout(treasury/.../commands/GovCommand.java:681):getOfflinePlayerIfCached(toName), thenknownPlayer = hasPlayedBefore()||isOnline(); null → "unknown-recipient"./fine(FineCommand) and/bal(BalanceCommand) take anOfflinePlayerarg resolved by Hibernia'sOfflinePlayerResolver(hibernia-framework/.../commander/resolvers/OfflinePlayerResolver.java:30), which deliberately usesgetOfflinePlayerIfCached(NOTgetOfflinePlayer(String)— that does a blocking Mojang lookup which breaks Bedrock/Floodgate names).
So any target who has aged out of (or was never loaded into) the usercache since the last restart can't be addressed by name. Same cache-dependency PAR-142 documents for /pay.
Fix direction
Add a deterministic DB-backed name→UUID/account fallback for when the usercache misses, instead of relying on Bukkit cache state. Treasury has no general name cache today; business owns firm_players(current_name → uuid) (FirmPlayerMapper.getByName), and player_login_times exists. The clean fix is the unified economy_players(name_lower → uuid) table proposed in PAR-35 — once it exists, route all bare-name resolution through it; interim: a PERSONAL-account name lookup on AccountService.
Acceptance
/gov payout,/fine,/balresolve a known player by name regardless of usercache state (test with a player who has played but isn't currently cached).- Bedrock/Floodgate names still avoid the blocking Mojang lookup.
Related: PAR-149 (same root cause, Bedrock employees), PAR-142 (/pay cache-dependency), PAR-35 (unified player table = the proper resolver source).
Comments
No comments yet.
Activity
- tesks changed status to Status → Pending Release
- tesks changed status to Status → In Progress
- tesks description: Description updated
- paradaux changed status to Status → Planned
- tesks created the issue