FlowFuse / device-agent

An agent to run FlowFuse managed instances of Node-RED on devices
Apache License 2.0
15 stars 8 forks source link

Unhandled exceptions can crash agent #207

Closed Steve-Mcl closed 9 months ago

Steve-Mcl commented 9 months ago

Current Behavior

If the agent gets into a particular state (i.e. bad module specified), the agent can be crashed by a simple MQTT command to update. This is due to several places in the code where callbacks are calling agent.setState(...) without a .catch or a try, await, catch.

These issues were uncovered while developing a separate feature but were super easy to get into but difficult to get out of.

Expected Behavior

Ideally, the agent should not be crash-able at all (should be recoverable by the interface no matter the state)

This obviously is a utopian goal but the items highlighted can easily be addressed.

Steps To Reproduce

No response

Environment