Repository navigation
Resend player meta when LuckPerms permissions change - #36
Conversation
A rank granted while a player was online (Patreon, staff panel or /lp) never reached the website until they rejoined, because player meta was only sent on join, reload and /web syncmeta. TFMCWeb now listens for LuckPerms UserDataRecalculateEvent and resends that player's meta about a second later. Those sends are skipped when nothing changed, since LuckPerms recalculates every online player on each sync-minutes sync, and a failed send is retried on the next recalculation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to This change resends player metadata to the website after LuckPerms recalculates permissions, skipping unchanged payloads. No concrete merge-blocking risk was found. Live-server behavior is untested by the author, which is normal pre-merge uncertainty.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review fixes: - Sends for one player now run through a single drain task that always sends the newest queued body, so an older body can no longer land after a newer one. Change detection compares against the newest body handed to the sender, not the last acknowledged one, so a change made while a send is in flight is still sent. - GroupDataRecalculateEvent checks every online player, so edits to what a rank grants also reach the website. - Scheduling rejected during shutdown no longer leaves a player stuck as pending, and an unexpected exception from the PUT cannot leave a player stuck as sending. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A PUT that times out on our side can still be processed by the website after a newer PUT, leaving the site on older meta while change detection skips the current body. After any failed send, unchanged bodies for that player are now resent at each recalculation until 10 minutes have passed since the last failure, so the periodic LuckPerms sync repairs a late write. Producers are documented as main-thread only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The repair window used to end ten minutes after the last failure even if the last successful resend came earlier, so a late write landing between that resend and the deadline went unrepaired. The failure marker is now cleared only by a send that succeeds at least ten minutes after the last failure. Comments no longer claim the website applies sends in order, and a fake-site test covers a timed-out write landing after a newer one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rank granted while a player is online never reached the website until they rejoined. On 11 October CaptainObviousXY linked Patreon at 16:33 UTC, got Gilded in game, and the site kept showing one wardrobe skin because TFMCWeb last sent his meta at his 16:23 join.
What changes
MetaResyncsubscribes to LuckPermsUserDataRecalculateEventandGroupDataRecalculateEvent(when LuckPerms is installed). A user event rechecks that player 20 ticks later; a group event rechecks every online player. Repeats within that second share one check, and scheduling rejected during shutdown leaves nothing pending.PlayerMetaSyncService.pushIfChangedskips the PUT when the resolved body equals the newest body already handed to the sender. LuckPerms 5.5.32 recalculates every online user and group on each storage sync (sync-minutes: 3on Main and Dev), so without this every online player would be resent every three minutes. Join, reload and/web syncmetastill always send.LuckPermsRecalculateListenerholds the only LuckPerms API references and is loaded by name, matching the rank writer and bridge.LuckPerms 5.5.32 fires these events from
setNode,unsetNode, temporary-node expiry andloadNodesFromStorage, so Patreon grants, staff-panel changes,/lpedits, rank-definition edits and changes synced from the other server are all covered.Testing
mvn clean verify: 160 tests pass and JaCoCo's 100% line coverage check is met. New tests cover send ordering when the meta changes during an in-flight send, retry after a failed or throwing PUT, a fake-site late write after a timeout, group rechecks and shutdown rejection.Docs: TF-Minecraft/Docs#141
🤖 Generated with Claude Code