Sometimes a route being preserved can cause confusion when it was preserved automatically or by an admin.
Currently GET /v1/devices/:dongleId/routes/preserved returns the list of preserved routes for a dongle and user. The API returns a 403 error when trying to DELETE /v1/route/:routeId/preserve a route that was preserved by another user. The same error code is used when the user has preserved too many routes (10, or 100 for prime users), so clients cannot tell the difference easily.
Some potential solutions:
- Differentiating the error code or adding an error message to the
/v1/route/:routeId/preserve endpoint so that clients can tell the difference between the two errors.
- Returning whether the user or someone else preserved the route in the API response to
GET /v1/devices/:dongleId/routes/preserved. This would allow the client to disable the preserve button altogether.
- Excluding routes preserved by admins from the list returned by
GET /v1/devices/:dongleId/routes/preserved. This might be more difficult to implement since you would want to keep track of separate RoutePreserved entries by the user and admins for each route, but would completely hide this behaviour from the users.
Sometimes a route being preserved can cause confusion when it was preserved automatically or by an admin.
Currently
GET /v1/devices/:dongleId/routes/preservedreturns the list of preserved routes for a dongle and user. The API returns a 403 error when trying toDELETE /v1/route/:routeId/preservea route that was preserved by another user. The same error code is used when the user has preserved too many routes (10, or 100 for prime users), so clients cannot tell the difference easily.Some potential solutions:
/v1/route/:routeId/preserveendpoint so that clients can tell the difference between the two errors.GET /v1/devices/:dongleId/routes/preserved. This would allow the client to disable the preserve button altogether.GET /v1/devices/:dongleId/routes/preserved. This might be more difficult to implement since you would want to keep track of separateRoutePreservedentries by the user and admins for each route, but would completely hide this behaviour from the users.