Azure / azure-iot-sdk-node

A Node.js SDK for connecting devices to Microsoft Azure IoT services
https://docs.microsoft.com/en-us/azure/iot-hub/
Other
261 stars 227 forks source link

Twin update event is not fired off after short disconnect #885

Closed nurevaSaeed closed 3 years ago

nurevaSaeed commented 4 years ago

repro steps: 1- connect your device to IoT hub. 2- disconnect device internet. 3- go to azure iot portal and change a twin property. 4- resume internet for the device.

expected behavior: Device connects back to IoT hub and gets notified that twin is updated.

current behavior: No event is fired off. The only way to get the event is to kill the application and run it again.

SDK version: "azure-iot-device": "1.11.2", "azure-iot-device-mqtt": "1.11.2"

It's worth mentioning that if the disconnect goes over the retry timeout (8-10 mins?) the azure-iot-device lib gives up and fires off a disconnect event. This issue happens if the disconnect get's resolved before the lib gives up.

AB#8142882

anthonyvercolano commented 4 years ago

@nurevaSaeed If you could give more details that would be helpful.

There are instructions on the new issue bug report for the information we need.

Additionally did you have environment variable DEBUG="azure,mqtt" set? Did you see if the device client ever actually noticed whether the connection was down?

nurevaSaeed commented 4 years ago

Hi Anthony. 1- where can I find those instructions? 2- no, I have not set DEBUG="azure,mqtt". 3- if internet is back in less than 8-10 mins the device doesn't notice the internet is gone.

cheers

anthonyvercolano commented 4 years ago

@nurevaSaeed

1 -Not sure how you opened the issue originally but opening the issue as a bug gives a list. 2 - Could be helpful 3 - If we don't notice the network being dropped (which on a Linux machine is most likely), then this is hard to deal with. The main problem being that using the MQTT transport the delta change will be pushed out by the hub but we simply won't see it and the hub won't know that we didn't. Even if we reconnect we won't know. The new value of desired property WILL be noticed on the client restart. I venture the possibility that if you use AMQP this will work better.

nurevaSaeed commented 4 years ago

Any update on the topic?

anthonyvercolano commented 3 years ago

Closing due to inactivity