Open daniil-berg opened 1 week ago
I agree that it makes sense to return a 404 status code if the specified file was not found. Although it would probably be even more interesting to receive a 500 status code if the deletion fails, because in that case the LMS may want to try again or log an error.
Requesting
DELETE
from the/api/file/<hash><ext>
endpoint currently provides no feedback, as to whether the storage node even controls a file with the provided hash/extension at all. If it does not, a warning is logged, but the client receives the same200
response either way.https://github.com/innocampus/videbo/blob/e7b53e0d6668e2b47b8a9a5342e8123a98845f12/src/videbo/storage/file_controller.py#L410-L417
No feedback/guarantees about successful deletion makes sense, but if the client application provided an invalid/unknown hash, it would be polite to respond accordingly. In this case, a
404
seems appropriate. The client is still free to ignore such a status code, but it may also be valuable information, in case there is a bug on the other end.@larsbonczek What do you think? The way I see it, there are no implications for
mod_videoservice
because it already ignores any non-200
response to a deletion request anyway. If anything, this is an opportunity to log this specific404
response on that end, too. That way we could more easily identify problems in setups with multiple LMS connected to one Videbo server. We always want to make sure that a file is only deleted, if it is no longer needed on any registered LMS. Better logging in the deletion process just seems like a good idea. (That is a topic formod_videoservice
, I just wanted to share my motivation for this issue here.)