equinor / flotilla

Flotilla is the main point of access for operators to interact with multiple robots in a facility.
Eclipse Public License 2.0
16 stars 38 forks source link

Fix flotilla not reporting connection issues after broker goes down #1781

Closed andchiind closed 1 month ago

andchiind commented 1 month ago

Closes #1359

Previously we were sending signalR messages that the robot had been updated with isarConnected being changed, but since the robotModel was null we were ignoring it in the frontend. This was occuring since we were not including the robot model in the database query we used when updating isarConnected. When I changed this to include the robot model we got an error since the ExecuteUpdateAsync function does not allow SQL JOINS (see https://learn.microsoft.com/en-us/ef/core/saving/execute-insert-update-delete#navigations-and-related-entities). I therefore normalised the code to use the context.Update function like we do in the rest of the RobotService. The only place that still uses ExecuteUpdateAsync is the UpdateRobotPose function as this one does not suffer from the same issues due to how the function is used (the return value is ignored), but it's worth keeping in mind.