edgehog-device-manager / edgehog-device-runtime

Edgehog Device Runtime is a portable middleware written in Rust, that enables remote device management on Linux-based systems.
Apache License 2.0
11 stars 10 forks source link

Unset ForwarderSessionState property after runtime restart #346

Open rgallor opened 4 months ago

rgallor commented 4 months ago

If the device runtime suddenly crashes and one or more device forwarder sessions were active, after it has been restarted, it will neither attempt to unset the sessions' state nor to re-establish them. To prevent this, it is necessary that, when initialized, the device forwarder retrieves the previously stored ForwarderSessionState property values from Astarte. However, this can only be done if the SqliteStore is being used, which can be trivial if the AstarteMessageHub is used instead of the AstarteDeviceSdk. It is necessary to modify the astarte-message-hub-proto and the AstarteMessageHub to enable the correct transmission of the ForwarderSessionState property values to the device.