emqx / CocoaMQTT

MQTT 5.0 client library for iOS and macOS written in Swift
https://www.emqx.com/en
Other
1.59k stars 418 forks source link

Subscription Ack is not getting Called in CocoaMQTTDelegate #420

Closed rajeevradhakrish closed 2 years ago

rajeevradhakrish commented 2 years ago

The following warning is coming from the MQTT library in subscription Ack and the delegate is not getting called. CocoaMQTT(warning): UNEXPECT SUBACK Recivied: SUBACK(id: 1)

The following code inside the library return with wear . I have tested with many brokers but still getting the same warning and ack fails.

guard topicsAndQos.count == suback.grantedQos.count else { printWarning("UNEXPECT SUBACK Recivied: (suback)") return }

leeway1208 commented 2 years ago

@rajeevradhakrish Thanks for your report. I will check it. I think the reason for this error is because the 3.1.1 and 5.0 are a little different in suback.

JGVB commented 2 years ago

getting CocoaMQTT(warning): UNEXPECT SUBACK Recivied: SUBACK(id: 1) **id 1-10

Does this cause any functional problems? Or is truly just a warning?

leeway1208 commented 2 years ago

@JGVB perhaps is our mistake. The newest version fix the subback frame problem.😄

tomerpetel commented 2 years ago

Any possibility this still occurs on 2.0.2?

I'm on 2.0.2 according to the Podfile.lock: ...

And still encountering this bug. It looks like the topics count and ack count are not the same. I'm failing here:

guard topicsAndQos.count == suback.grantedQos.count else { printWarning("UNEXPECT SUBACK Recivied: \(suback)") return }

I tried to subscribe to one topic only and still seeing the issue

leeway1208 commented 2 years ago

hi @tomerpetel try the newest tag 2.0.3-beta2. Please let me know if there are still any issues. Thanks.

tomerpetel commented 2 years ago

@leeway1208 It's working on 2.0.3-beta2 :) when a prod release is planned?

leeway1208 commented 2 years ago

ASAP 😄😄

axelpart commented 1 year ago

Hello @leeway1208. We recently upgraded using the latest version 2.0.4 and we also started seeing the same warning. Same result observed as described on the initial comment, delegate is not called:

CocoaMQTT(warning): UNEXPECT SUBACK Recivied: SUBACK(id: 1)
CocoaMQTT(warning): UNEXPECT SUBACK Recivied: SUBACK(id: 2)
...

We tried to use array of topics and pass individual topics but the warning is still occurring. Any recommendations on overcoming the issue?