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

Handle Debug server host & port values that start with "http://" more friendly. #17644

Closed
joshuapinter opened this issue Jan 17, 2018 · 1 comment
Labels
Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@joshuapinter
Copy link
Contributor

Is this a bug report?

Yes. I guess. More like an improvement.

Have you read the Contributing Guidelines?

Yes

Environment

$ react-native info
  Unrecognized command 'info'

Steps to Reproduce

  1. Edit Debug server host & port for device.

  2. Enter in a value that includes http://.

  3. When trying to connect to the React Native packager, it will try http://http://....

Expected Behavior

I would expect that it to smartly not add http:// to an address that already contains http://.

Actual Behavior

It adds http:// to the address, thus duplicating it to http://http://

Reproducible Demo

Not necessary. Just launch the dev menu and see for yourself.

My Notes

When adding the IP address and port number for the React Native packager, the "http://" is automatically added. So, when people add "http://127.0.0.1:8081" in here, it tried to find the React Native package server at "http://http://127.0.0.1:8081".

I accidentally do this all the time and I'm sure others, especially newcomers, do as well.

I'm happy to issue a PR to make this more friendly but wanted to get your opinion on the direction.

  1. Add a prefix to the EditText that shows "http://" so that it hints to the developer that there is no need to enter in the "http://" part.

  2. When accepting the value, if the string starts with "http://" remove it.

  3. When using the value, if the string starts with "http://" don't add it.

I'm leaning towards 3.

Let me know what you think and I'll take a look.

Thanks.

Josh

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon. labels Feb 24, 2018
@facebook facebook locked and limited conversation to collaborators May 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants