Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application command auto-complete validation bug #7350

Open
solithcy opened this issue Jan 19, 2025 · 14 comments
Open

Application command auto-complete validation bug #7350

solithcy opened this issue Jan 19, 2025 · 14 comments
Labels

Comments

@solithcy
Copy link

solithcy commented Jan 19, 2025

Description

If you create an application command with an auto-complete option as the first argument, and an argument with set choices as another argument, auto-complete requests for the first argument will fail due to the other argument not having a valid value, despite the user not getting to that option yet.

Please find attached screenshots of the failed auto-complete on the web client, and the auto-complete request body and response.

Steps to Reproduce

  1. Create an application command with the first argument being a required autocomplete text input, and the second option being a required text input with 2 different choices (i.e. choice-1 and choice-2).
  2. Begin typing in this command and press TAB to autocomplete the command, as this will then add the other arguments automatically which then causes the bug.
  3. Observe the auto-complete request failure.

Expected Behavior

The second option not being set to one of the available choices should be ignored, and the auto-complete request should go through.

Current Behavior

The auto-complete request fails due to the second argument that hasn't been set being invalid.

Screenshots/Videos

Command with the auto-complete options

Request body

Request response

Client and System Information

API version 9, web-client build 360320 (38aca73)
Windows 11

@solithcy solithcy added the bug label Jan 19, 2025
@sphericle
Copy link

Same here, this had me running in circles for 2 days trying to figure out why my autocomplete is failing LOL. My temp fix was to move the option(s) that uses choices to the front 👍

@azatoth
Copy link

azatoth commented Jan 19, 2025

I've have had the same issue as well;
Suddenly two days ago, the autocomplete functionality for first argument started to fail loading, and I've been unable to locate any clues to why this is happening;
This command has one autocomplete as first parameter, and one choices as third parameter.
Testing it now by explicitly setting the third option to a valid choice allows the first parameter to properly autocomplete.

@maxed-dev
Copy link

Experiencing this too! I initially thought it was an issue on my end and spent hours debugging. I can confirm that the same error appears in the network tab.

@Pollyvx
Copy link

Pollyvx commented Jan 19, 2025

I have the same issue.

@FDS-Dark
Copy link

spent 2 days trying to fix this issue, i thought i was going crazy until i checked the network logs

@dimasaryo
Copy link

Got the same issue

@M0nk-e
Copy link

M0nk-e commented Jan 21, 2025

Soooooooo.. When the user starts typing and auto-completing the first argument, the command system tries to validate all required arguments for the interaction.
Since the second argument is required but has not yet been set to a valid choice, the auto-complete request fails. This happens because the system sees the second argument as "invalid" for the request, even though the user hasn't reached it yet.

auto-complete request fails because all required arguments are validated...
yes, even if the user is still in the middle of filling out earlier arguments. The system does not defer the validation of previous arguments until after the current one is resolved.

@Rodaviva29
Copy link

Same here, but it works fine in Mobile Devices App for me.

@wleroux
Copy link

wleroux commented Jan 21, 2025

I'm having the same issue.

@Auralytical
Copy link
Contributor

Auralytical commented Jan 22, 2025

Thanks everyone for this report + comments! This bug popped up as a result of some validation fixes + cleanup, and tests didn't catch this specific scenario -.-

I've pushed a fix to Canary + PTB for the examples in this thread. Please let me know if any of your autocomplete commands are still failing validation but were working last week.

@Rodaviva29
Copy link

Rodaviva29 commented Jan 22, 2025

Thanks everyone for this report + comments! This bug popped up as a result of some validation fixes + cleanup, and tests didn't catch this specific scenario -.-

I've pushed a fix to Canary + PTB for the examples in this thread. Please let me know if any of your autocomplete commands are still failing validation but were working last week.

Hey Auralytical, thanks for following up! Just tested in Canary Discord [canary 361564 (edcb982)]. It still don't work and also stopped working in Mobile Devices as well! I have some commands with Autocomplete that have also Choices and UserOption.

@sphericle
Copy link

sphericle commented Jan 23, 2025

Thanks everyone for this report + comments! This bug popped up as a result of some validation fixes + cleanup, and tests didn't catch this specific scenario -.-

I've pushed a fix to Canary + PTB for the examples in this thread. Please let me know if any of your autocomplete commands are still failing validation but were working last week.

Seems to work for me on canary 362011 (125f4be), thanks!!
Edit: working on stable as well :)

@Auralytical
Copy link
Contributor

@Rodaviva29 - I'm a little surprised this affects mobile too - some of the recent changes touch shared code, but I believe most of it was specific to web/desktop o.O

Either way, if it's still broken, please post an example command and i'll look into it

@Rodaviva29
Copy link

@Rodaviva29 - I'm a little surprised this affects mobile too - some of the recent changes touch shared code, but I believe most of it was specific to web/desktop o.O

Either way, if it's still broken, please post an example command and i'll look into it

@Auralytical , nevermind, when all this happened I started the development build with a different MongoDB collection and forgot about that part. >.<, thank you so much for your help! Keep it up! It works fine in all type of devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests