phedny opened a new issue #3608:
URL: https://github.com/apache/couchdb/issues/3608


   [NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ 
)
   
   ## Description
   
   When sending a POST request to `/db/_bulk_get` endpoint that requests a 
document that has been deleted, this is not returned as an error, but as an ok.
   
   ## Steps to Reproduce
   
   Assuming a local database `demo`:
   
   1. Create a document: `curl -X PUT http://localhost:5984/demo/id --header 
$AUTH_HEADER --header $JSON_HEADER -d '{"key":"value"}'`
   2. Delete the document: `curl -X DELETE 
http://localhost:5984/demo/id\?rev=1-59414e77c768bc202142ac82c2f129de --header 
$AUTH_HEADER`
   3. Bulk get the document by `_id`: `curl -X POST 
http://localhost:5984//demo/_bulk_get $AUTH_HEADER --header $JSON_HEADER -d 
'{"docs": [{"id": "id"}]}'`
   
   ## Expected Behaviour
   
   I expected a result that is similar to the situation when the document had 
never existed (with `reason` set to `deleted` instead of `missing`), e.g.
   ```json
   {"results": [{"id": "id", "docs": 
[{"error":{"id":"id","rev":"undefined","error":"not_found","reason":"deleted"}}]}]}
   ```
   
   The actual result is:
   ```json
   {"results": [{"id": "id", "docs": 
[{"ok":{"_id":"id","_rev":"2-9b2e3bcc3752a3a952a3570b2ed4d27e","_deleted":true}}]}]}
   ```
   
   ## Your Environment
   
   ```json
   
{"couchdb":"Welcome","version":"3.1.1","git_sha":"ce596c65d","uuid":"f232e7548ad3f073ffa6c1126f918b79","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The
 Apache Software Foundation"}}
   ```
   
   * CouchDB version used: 3.1.1
   * Browser name and version: N/A
   * Operating system and version: Linux, OS X and Windows
   
   ## Additional Context
   
   [TIP]:  # ( Add any other context about the problem here. )
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to