Skip to content

_reconnect call deliberately fails if currently connected, not matching docs (IDFGH-16113) #308

@hachi

Description

@hachi

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

When I call esp_mqtt_client_reconnect while already connected I would expect it to trigger a disconnect and reconnect even if automatic reconnection is disabled.

This api is typically used to force reconnection upon a specific event.

Actual behavior (suspected bug)

https://github.com/espressif/esp-mqtt/blob/master/mqtt_client.c#L1893

It actually just returns a failure saying a reconnect is not currently in progress.

I do understand that behavior changes might not be a good idea, but the documentation should probably reflect it better.

I would say that the imperative reconnect would be wrong for the function it does.... this function causes the client to connect, because it can only be called after you have disconnected and already entered the reconnect state.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions