wialon / gmqtt

Python MQTT v5.0 async client
MIT License
385 stars 53 forks source link

fix: re-subscribe after re-connect #153

Closed KeNaCo closed 4 months ago

KeNaCo commented 4 months ago

Closes #124 .

The solution was tested with a test suite and manually with ActiveMQ (MQTT3.1) as this was the place where I encountered the problem.

Lenka42 commented 4 months ago

Hi!

Thank you for your pull request. To be honest, I hadn't planned to include this functionality in the library, preferring to leave it to the user's discretion.

I have a couple of concerns regarding your proposed changes:

  1. You do not check, if there exists session, and therefore if subscription is actually needed. Which could potentially lead to unnecessary subscription requests.

  2. Additionally, it would be beneficial to have specific pytest cases added to cover the functionality introduced by this PR.

KeNaCo commented 4 months ago

Hi.

Thank you for your feedback. I don't mind not having it in the library if there is a reasonable way to solve it in user code. In such a case, I'm closing this PR and moving the discussion to the issue comments.