Description
Prerequisites
Note: You may remove this section prior to submitting your report.
A small team of volunteers monitors issues, so it's important that we can quickly understand what you are requesting, and
why it would be of benefit. Prior to requesting a feature, please:
- Search existing issues (the feature may have been requested previously).
- Read the relevant documentation.
- Consider the impact your feature/idea might have on other users of the library (both positive and negative).
- Decide if you are able to implement the feature yourself (please do raise an issue before submitting a pull request).
Feature Description
Please provide a clear and concise description of the feature you are requesting. Include details of the benefits you
believe the feature will deliver (i.e. problems it will solve, user groups it will help etc).
The client will_set method (and similarly will_clear) has no effect if called after connect. This is documented in the documentation at https://eclipse.dev/paho/files/paho.mqtt.python/html/client.html#paho.mqtt.client.Client.will_set, but not in the documentation at https://pypi.org/project/paho-mqtt/. While this may also be understood by frequent users of MQTT, it isn't so clear to those new to it.
The result is that calling this results in a "silent failure" where the will is never enacted because it's only sent to the broker during connection.
Requested Solution
Describe how you would like this feature delivered (for example, if adding functionality, show mock code using the new
feature)
- Update the PyPi documentation (or remove it if it's better that the eclipse.dev domain should be the source of truth).
- Consider raising an exception if the will_set or will_clear methods are called on a connected client. While the new exception may be frustrating to those updating and now seeing the error, this is less problematic than a will never sent.
Alternatives
Have you considered alternative ways of accomplishing your goal? If so please provide details.
Additional Information
Is there any other information you can provide that would help us understand your idea?
https://stackoverflow.com/questions/28612283/problems-with-mosquitto-and-last-will-testament