ArduinoIoTCloud icon indicating copy to clipboard operation
ArduinoIoTCloud copied to clipboard

fix: infinite disconnect loop

Open zfields opened this issue 7 months ago • 2 comments

When a disconnect occurs, a reset message is provided to both the _thing and _device containers, but there is no subsequent call to _thing.update() or _device.update() to process the message and actually reset the state.

This results in an infinite loop, because !_device.connected() (i.e. not not disconnected) will ALWAYS remain true.

This seems like the appropriate place for the call to update(), because ResetCmdId puts the _device and _thing containers into their disconnected state then update() processes the disconnect and restores them to their initialization state (same state that results from begin() just before we enter the state machine).

zfields avatar Jul 02 '24 14:07 zfields