Skip to content

fix: skip player UUID lookups while suggesting history arguments - #3725

Open
MattBDev wants to merge 1 commit into
mainfrom
thunder/history-list-player-exception-8e5e25
Open

MattBDev wants to merge 1 commit into
mainfrom
thunder/history-list-player-exception-8e5e25

Conversation

@MattBDev

@MattBDev MattBDev commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #3303. Based off of the feedback received in #3306. Replacing the UUID argument in the commands to Player didn't make much sense especially since there is no converter for Player. The easier solution was the one that @PierreSchwang mentioned with a few additions to it.

The client requests command suggestions on every keystroke, and the
player UUID binding resolved each partial name through the platform,
which on Bukkit looks unknown names up on the Mojang API. Return the
actor's UUID during suggestion parsing instead, and suggest online
player names plus me, * and console for UUID arguments.

Fixes #3303
@MattBDev
MattBDev requested a review from a team as a code owner November 9, 2026 02:38
Copilot AI balanced review requested due to automatic review settings November 9, 2026 02:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟡 Changes recommended

The change still risks throwing an uncaught IllegalArgumentException during tab-completion because UUID.fromString(argument) is invoked on partial/invalid UUID input in ConsumeBindings.java (lines 175 and 196), leaving an active moderate issue that undermines the goal of avoiding pre-execution exceptions.

1 open issue
What changed in this PR

This pull request updates command argument binding behavior to avoid performing player UUID resolution (including potentially expensive/offline lookups) during tab-completion parsing, and adds a binding-level hook for providing tab-completion suggestions—targeting the //history list <player> completion crash/exception scenario.

Changes:

  • Short-circuit UUID/player resolution during “suggestion parsing” to prevent pre-execution exceptions and avoid remote/offline lookups.
  • Add a Bindings#getSuggestions(...) hook so binding-registered converters can supply tab-completion candidates.
  • Implement UUID-argument suggestion generation (including online player names when available).

Outstanding review comments to address before approval:

  • During suggestion parsing, UUID.fromString(argument) may still throw on partial/invalid UUID input; catch IllegalArgumentException and fall back safely (also noted at another location in the same file).
  • During suggestion parsing, always returning the executing actor’s UUID can produce incorrect downstream suggestions when a different online player name was typed; prefer resolving exact online matches first, then fall back.

This pull request requires changes.

File Summary
worldedit-core/​src/​main/​java/​com/​fastasyncworldedit/​core/​extension/​platform/​binding/​ConsumeBindings.java Skips UUID lookups during suggestion parsing and adds UUID argument completion suggestions.
worldedit-core/​src/​main/​java/​com/​fastasyncworldedit/​core/​extension/​platform/​binding/​Bindings.java Adds a generic suggestions hook and forwards converter tab-completion to binding-specific logic.

Review effort: Balanced

Comment on lines 175 to 177
if (argument.length() > 16) {
uuid = UUID.fromString(argument);
} else {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave this behavior to the rest of the @IntellectualSites/fastasyncworldedit-team to decide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

//history list <player> yields exception before completion

2 participants