Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closing a menu cancels its repeating tasks, but does not invalidate refresh work that has already been queued. An asynchronous refresh can finish after
closeMenuremoves the holder and its main-thread completion can start a new placeholder update task. That task is no longer covered by the holder's normal close lifecycle.This can result in repeated placeholder requests for disconnected viewers. PlaceholderAPI passes null to player-only expansions for offline players, which may produce repeating exceptions when an expansion assumes an online player.
Changes
Regression test
The test scheduler queues a refresh, executes its asynchronous selection, closes the holder, and then executes the pending main-thread completion. The completion must not render items or restart a task. Removing the completion guard makes this test fail; restoring it passes.
Eight tests cover the two close-during-refresh phases, rejection of task starts for closed/offline holders, idempotent cancellation of both tasks, a queued tick after disconnect, offline placeholder targets, and normal online placeholder/item updates.
Validation
gradlew clean test shadowJar --no-daemon --console=plainpassed on Java 21.This is a focused lifecycle fix, not a rewrite of all asynchronous menu operations, nor a general null-safety fix for third-party expansions. Validation uses mocked Bukkit objects and a controlled scheduler; real-server acceptance testing remains outstanding.