js icon indicating copy to clipboard operation
js copied to clipboard

[Bug]: Validation needed on Connect New Device IP Address/Hostname

Open fifieldt opened this issue 10 months ago • 2 comments

Hardware

Other

Connection Type

HTTP

Local or Hosted

https://client.meshtastic.org

Firmware Version

2.6.0

Description

Steps to reproduce:

  1. Open https://client.meshtastic.org/
  2. New connection --> HTTP
  3. 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


fifieldt avatar Feb 11 '25 06:02 fifieldt

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

danditomaso avatar Feb 11 '25 18:02 danditomaso

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

sachaw avatar Mar 01 '25 14:03 sachaw