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

api:core:incoming-phone-numbers:update help message displays incorrect information #255

Open
settermjd opened this issue May 24, 2021 · 2 comments
Labels
status: help wanted requesting help from the community triage queue Issue is in our internal backlog. It's either a bug or a feature enhancement. type: bug bug in the library

Comments

@settermjd
Copy link

settermjd commented May 24, 2021

Issue Summary

If you view the help message for the api:core:incoming-phone-numbers:update command, you see the following terminal output:

--voice-method=(head|get|post|patch|put|delete)            The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`.

There are three issues here:

  1. The capitalization of the HTTP methods in the text description on the right is what the method accepts. The lowercase versions of the HTTP methods in the pseudo-call to the command, on the left, are not. It seems entirely possible to suspect that a user might only look at the pseudo example call and attempt to pass a lowercase HTTP method. If they do that they'll see the following error message printed to the console:
 » Flag value validation errors:
 »   voice-method: "post" is not one of "HEAD,GET,POST,PATCH,PUT,DELETE"
 » Cannot execute command
  1. The pseudo example call on the left lists additional HTTP methods which the option does not accept (head, patch, put, and delete).
  2. The validation error also contains more HTTP methods than the option accepts.

Steps to Reproduce

  1. Call the api:core:incoming-phone-numbers:update command and pass the --voice-fallback-method option with a lowercase HTTP method as the option's value, as in the example below.

Code Snippet

twilio api:core:incoming-phone-numbers:update \
  --sid PNb1111111111111111 \
  --voice-url "..." \
  --voice-method=post

Exception/Log

# paste exception/log here

Technical details:

  • twilio-cli version: twilio-cli/2.24.0 darwin-x64 node-v14.15.4
  • node version: v14.15.4
  • Command output with debug logging enabled (adding -l debug to the end of the command):
[DEBUG] Config File: /Users/username/.twilio-cli/config.json
[DEBUG] Using profile: username
[DEBUG] Found command "api:core:incoming-phone-numbers:update" plugin: twilio-cli
[DEBUG] Found keytar version in "@twilio/cli-core" dependencies: ^7.6.0
[DEBUG] Schema for "sid": {"maxLength":34,"minLength":34,"pattern":"^PN[0-9a-fA-F]{32}$","type":"string"}
[DEBUG] Schema for "voice-url": {"description":"The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set.","format":"uri","type":"string"}
[DEBUG] Schema for "voice-method": {"description":"The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`.","enum":["HEAD","GET","POST","PATCH","PUT","DELETE"],"type":"string"}
[DEBUG] Provided flags: {"sid":"...","voice-url":"...","voice-method":"post","cli-log-level":"debug","properties":"sid,phoneNumber,friendlyName","skip-parameter-validation":false,"cli-output-format":"columns"}
 » Flag value validation errors:
 »   voice-method: "post" is not one of "HEAD,GET,POST,PATCH,PUT,DELETE"
 » Cannot execute command
[DEBUG] TwilioCliError: Cannot execute command
    at ApiCommandRunner.validateFlags (/usr/local/Cellar/twilio/2.24.0/libexec/src/services/twilio-api/api-command-runner.js:61:13)
    at ApiCommandRunner.run (/usr/local/Cellar/twilio/2.24.0/libexec/src/services/twilio-api/api-command-runner.js:24:10)
    at NewCommandClass.run (/usr/local/Cellar/twilio/2.24.0/libexec/src/base-commands/twilio-api-command.js:39:35)
    at async NewCommandClass._run (/usr/local/Cellar/twilio/2.24.0/libexec/node_modules/@oclif/command/lib/command.js:43:20)
    at async Config.runCommand (/usr/local/Cellar/twilio/2.24.0/libexec/node_modules/@oclif/config/lib/config.js:173:24)
    at async Main.run (/usr/local/Cellar/twilio/2.24.0/libexec/node_modules/@oclif/command/lib/main.js:27:9)
    at async Main._run (/usr/local/Cellar/twilio/2.24.0/libexec/node_modules/@oclif/command/lib/command.js:43:20)
@Sindhura3
Copy link
Contributor

Sindhura3 commented May 24, 2021

@settermjd Thanks for raising the issues. They have been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

@Sindhura3 Sindhura3 added the type: bug bug in the library label May 24, 2021
@thinkingserious thinkingserious added the status: help wanted requesting help from the community label May 24, 2021
@settermjd
Copy link
Author

Thanks kindly, @Sindhura3.

@shrutiburman shrutiburman added the triage queue Issue is in our internal backlog. It's either a bug or a feature enhancement. label Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community triage queue Issue is in our internal backlog. It's either a bug or a feature enhancement. type: bug bug in the library
Projects
None yet
Development

No branches or pull requests

4 participants