Clarify behavior of DELETE endpoints #147

Closed
opened 2025-10-09 06:41:28 +00:00 by mih · 3 comments
mih commented 2025-10-09 06:41:28 +00:00 (Migrated from github.com)

Docs say

DELETE /<collection>/record?pid=<pid>: delete an object with the pid from the incoming area of the collection , if the provided token allows writing to the incoming area. The result is either True if the object was deleted or False if the object did not exists or was not deleted.

It is unclear to me how one would infer a legitimate error from this behavior.

It appears that the endpoints return HTTP200 in all cases. It would make sense to me to code error conditions in HTTP responses as much as possible. Deleting a record that doesn't exist should 404, rather than return false in the body. I think.

Docs say > `DELETE /<collection>/record?pid=<pid>`: delete an object with the pid <pid> from the incoming area of the collection <collection>, if the provided token allows writing to the incoming area. The result is either True if the object was deleted or False if the object did not exists or was not deleted. It is unclear to me how one would infer a legitimate error from this behavior. It appears that the endpoints return HTTP200 in all cases. It would make sense to me to code error conditions in HTTP responses as much as possible. Deleting a record that doesn't exist should 404, rather than return `false` in the body. I think.
mih commented 2025-10-09 06:42:26 +00:00 (Migrated from github.com)

Related: Using DELETE /<collection>/record?pid= and a CURATOR token, I cannot delete a record, but I am able to delete it via DELETE /<collection>/curated/record?pid=

Related: Using `DELETE /<collection>/record?pid=` and a CURATOR token, I cannot delete a record, but I am able to delete it via `DELETE /<collection>/curated/record?pid=`
christian-monch commented 2025-10-17 09:32:53 +00:00 (Migrated from github.com)

Related: Using DELETE /<collection>/record?pid= and a CURATOR token, I cannot delete a record, but I am able to delete it via DELETE /<collection>/curated/record?pid=

If the record is in the curated area it can only be deleted via the curator URL, i.e., DELETE /<collection>/curated/record?pid=. If the "normal user" URL, i.e, DELETE /<collection>/record?pid= is used, the CURATOR token behaves like any other token. That means it will read from the curated area in its incoming area, and it will delete from the incoming area.

> Related: Using `DELETE /<collection>/record?pid=` and a CURATOR token, I cannot delete a record, but I am able to delete it via `DELETE /<collection>/curated/record?pid=` If the record is in the curated area it can only be deleted via the curator URL, i.e., `DELETE /<collection>/curated/record?pid=`. If the "normal user" URL, i.e, `DELETE /<collection>/record?pid=` is used, the CURATOR token behaves like any other token. That means it will read from the curated area in its incoming area, and it will delete from the incoming area.
christian-monch commented 2025-10-17 13:25:15 +00:00 (Migrated from github.com)

Fixed in PR #159, published in Version 5.0.0

Fixed in PR #159, published in Version 5.0.0
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
orinoco/dump-things-server#147
No description provided.