Verify which mission has been stopped #1982
Labels
backend
Backend related functionality
good first issue
Good for newcomers
improvement
Improvement to existing functionality
Describe the improvement you would like to see
In StopCurrentMissionRun in MissionSchedulingService.cs we check the current robot mission run to see if it exists and then we send an API request to the robot to make it stop its current mission (without us telling it which mission in particular this is). We then move the stopped mission in Flotilla to the queue again.
I suggest that we verify which mission it is that we stopped. This should be done by comparing the IsarMissionId with a value returned by the robot. This can either be by sending the mission ID in the stop request, so that the robot only stops the mission if the IDs match, or in the return value of the stop call, so that the 200 status code reply also includes the ID of the mission that was stopped. This would allow us to only move missions that were actually stopped to the queue.
Additionally, I suggest we don't read in the robot and mission object again in this function, but instead pass in the robot object, as we will anyways need to have the robot object to make this function call.
All of this also applies to pausing missions.
How will this change existing functionality?
It will improve consistency between ISAR and Flotilla.
How will this improvement affect the current Threat Model?
N/A, unless cancelling the wrong mission can be considered a vector of attack.
The text was updated successfully, but these errors were encountered: