Issues with client completion and flags #3356
Labels
status: investigation
Marks an issue as needing investigation, usually for specific block of code or logic
system: command
type: bug
Something isn't working
version: 1.16 (u)
API: 8
This is related to #3349, however this is a tougher problem to fix due to the nature of flags.
Basically, the problem is this - if you have two or more nodes that are identical except for their redirects, due to the equality check not including redirects, the nodes are "deduplicated" on the client meaning that the two different nodes on the server act as the same on the client. This results in the completion after a flag redirecting to the first command that specifies the flag.
If we could control the vanilla client, the solution is to add redirects to the equality check - however the reason why I think this wasn't done is that
/execute
does something broadly similar to flags in that it allows for redirecting to a point earlier in the command where it is then feasible to get back to the node, causing an infinite loop when checking for equals and thus cause a stack overflow. The real solution would be to patch Brig to handle this properly by doing a reference equality check for any redirected nodes (that's what we do on the server) - a redirect should be targetting a node in the tree so that should suffice, but without control of the client this is not easy.I'll likely PR a patch in to Brig soon, though most PRs there have not seen any action over the last couple of years (one of aikar's PRs was pulled along with a couple of smaller fixes directly committed, but that's it). So we need to see if we can creatively work our way around the problem in Sponge because this might be a problem for some time.
Note that like in #3349, entering the command string will parse correctly, this is purely to do with tricking the client to make completions work there.
We may be able to do something using standard argument nodes, but that's going to make completion more ambiguous.
The text was updated successfully, but these errors were encountered: