Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since version 2.0 calling client.reinitialise() raise RuntimeError: Unsupported callback API version #824

Open
Mips2648 opened this issue Mar 8, 2024 · 1 comment
Labels
Status: Available No one has claimed responsibility for resolving this issue. Type: Bug

Comments

@Mips2648
Copy link

Mips2648 commented Mar 8, 2024

Bug Description

Since version 2.0, as argument "callback_api_version" is require, calling client.reinitialise() raise RuntimeError: Unsupported callback API version because this method do not provide it

current code:

    def reinitialise(
        self,
        client_id: str = "",
        clean_session: bool = True,
        userdata: Any = None,
    ) -> None:
        self._reset_sockets()

        self.__init__(client_id, clean_session, userdata)  # type: ignore[misc]

I suppose this could be changed to

self.__init__(self._callback_api_version, client_id, clean_session, userdata)  # type: ignore[misc]

Reproduction

Simply init a client then call reinitialise()

mqtt_client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
mqtt_client.username_pw_set(username="user", password="pass")
mqtt_client.connect(...)
mqtt_client.loop_start()

...

mqtt_client.reinitialise()

Environment

  • Python version:
  • Library version:
  • Operating system (including version):
  • MQTT server (name, version, configuration, hosting details):
@github-actions github-actions bot added the Status: Available No one has claimed responsibility for resolving this issue. label Mar 8, 2024
@henryptung
Copy link

The API break was so wide-impact it broke its own codebase? Oof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Available No one has claimed responsibility for resolving this issue. Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants