js
js copied to clipboard
[Bug]: Validation needed on Connect New Device IP Address/Hostname
Hardware
Other
Connection Type
HTTP
Local or Hosted
https://client.meshtastic.org
Firmware Version
2.6.0
Description
Steps to reproduce:
- Open https://client.meshtastic.org/
- New connection --> HTTP
- In the 'IP Address/Hostname' box, paste in a string with characters illegal for an IP or hostname, like "http://127.0.0.1:4403/"
What should happen:
- Suitable error message should be displayed, connection is prevented
What happens instead
- Connection attempt goes through, and then fails cryptically since it's not a valid hostname/IP
Relevant console output
100% agree on this, we need do some plumbing fixes inside the @meshtastic/js repo to support this, but overall this is something we need to add, as I am consistently annoyed when I dont get a connection but can still see the UI
We should now be able to achieve this.
as the transport is now decoupled, I've added a device probe in the transport that will throw if the device can't be reached.
const transport = await TransportHTTP.create(data.ip, data.tls);
const connection = new MeshDevice(transport, id);
now we just need to add the functionality to the connection dialog