emqx / CocoaMQTT

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

When recovering session, frame (FramePublish) topic is empty #563

Closed ltAldoRaine closed 4 months ago

ltAldoRaine commented 8 months ago

Hello,

I have installed the 2.1.6 version via Cocoapods.

I'm facing very strange issue, it seems like, when opening and closing application very fast, some publish requests are saved in the UserDefaults and then recoverSessionBy method grabs those requests and publishes again, issue is when it's retrieving frames from the userdefaults, data decoding is not happening correctly, there is no value in the topic variable for mqtt version 5.0.

Please check screenshot below

ltAldoRaine commented 8 months ago

Cocoamqtt sends message with empty topic and MQTT broker rejects it and client is disconnected

Screenshot 2023-10-31 at 10 38 18

JaylinYu commented 8 months ago

NULL topic publish is a malformed msg

ltAldoRaine commented 8 months ago

@JaylinYu Yes, I know. Cocomqtt is sending message with empty topic

JaylinYu commented 8 months ago

Could u kind check if this is fixed by commit ff7c07b