MQTTX icon indicating copy to clipboard operation
MQTTX copied to clipboard

[Bug] Auto-Reconnect does not handle configuration change

Open SpeckiJ opened this issue 5 months ago • 1 comments

What did I do

  1. Try to connect to a broker with default settings but invalid Path (e.g. connecting to wss://broker.emqx.io:8084/mqtt_invalid_path.

  2. Notice that the Path is wrong, open configuration and fix the path (/mqtt_invalid_path --> /mqtt).

  3. Close configuration and start a new connection with the new configuration

What happened

The client successfully connects after fixing the configuration. But I receive Alerts about Reconnecting every couple of seconds. When looking at the Network-Tab in the Browser console it shows that it still tries to reconnect with the old invalid configuration, although i have changed them already.

The only workaround i have found so far to get rid of the background-reconnects is to refresh the page (via F5 or Ctrl+R in the Desktop Client).

Expected

When changing the configuration of a client all auto-reconnection attempts for this client should be cancelled. After I have changed the configuration the old configuration should not be used anymore.

Environment

More detail

Screenshot of Proxy showing the requests that are sent out by the client. Blue marks the point in time where the configuration was fixed:

mqttx_test drawio(1)

This is probably a duplicate to https://github.com/emqx/MQTTX/issues/1680 that was unfortunately closed due to inactivity.

SpeckiJ avatar Sep 02 '24 15:09 SpeckiJ