-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
None
-
2
-
NEW
-
NEW
This is possible due to a UI bug:
- Go to the Route screen.
- Select vehicle that has no visits (stays in the depot).
- The depot is on its itinerary list (that's OK) but its remove button should be disabled, and it's enabled.
This is a corner case issue and is easy to fix but it can be used to demonstrate much more important problem and that is the lack of atomicity in LocationService.removeLocation().
The backend needs to be super defensive. It's nice that the UI disables elements to avoid invalid actions but it can contain glitches like this. The backend must not rely on valid input.
Another problem: First, location is removed in service layer, then business logic in a plugin says it's not allowed to remove it, and then we need to roll back. This is because the business logic (depot vs. visits) is being implemented in a plugin (planner).