You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by gi...@git.apache.org on 2017/04/24 04:28:28 UTC

[GitHub] jiangphcn opened a new pull request #486: Avoid creation of document if deleting attachment on non-existent doc

jiangphcn opened a new pull request #486: Avoid creation of document if deleting attachment on non-existent doc
URL: https://github.com/apache/couchdb/pull/486
 
 
    <!-- Thank you for your contribution!
        
        Please file this form by replacing markdown commentary
        tags with the text. If section needs in no action - remove it.
   
        Also remember, that CouchDB uses the Review-Then-Commit (RTC) model 
        of code collaboration. Positive feedback provides by +1 from committers
        while negative by -1. The -1 also means veto and need to be addressed
        to find the consensus. Once there are no objections, PR could be merged.
   
        See: http://couchdb.apache.org/bylaws.html#decisions for more info -->
   
   ## Overview
   
   <!-- Please give a short brief for the pull request,
        what problem it solves or how it makes things better. -->
   Prior to the change in this PR, one new document was unexpectedly created after a request is issued to delete attachment on non-existent document. This PR is aimed to address this to return 404 (Not Found) instead of creating new document. 
   
   ## Testing recommendations
   The newly introduced test case `should_return_404_for_delete_att_on_notadoc` covers the steps to test the change in this PR. In addition, two additional test cases `should_return_409_for_del_att_without_rev` and `should_return_200_for_del_att_with_rev` are introduced to make sure that there is no regression.
   ```
   ======================== EUnit ========================
   chttpd db tests
     chttpd_db_test:71: should_return_ok_true_on_bulk_update...[0.107 s] ok
     chttpd_db_test:86: should_accept_live_as_an_alias_for_continuous...[0.054 s] ok
     chttpd_db_test:107: should_return_404_for_delete_att_on_notadoc...[0.005 s] ok
     chttpd_db_test:129: should_return_409_for_del_att_without_rev...[0.052 s] ok
     chttpd_db_test:155: should_return_200_for_del_att_with_rev...[0.078 s] ok
   [os_mon] cpu supervisor port (cpu_sup): Erlang has closed
     [done in 1.563 s]
   ```
   <!-- Describe how we can test your changes.
        Does it provides any behaviour that the end users 
        could notice? -->
   
   ## JIRA issue number
   COUCHDB-3362
   <!-- If this is a significant change, please file a JIRA issue at:
        https://issues.apache.org/jira/browse/COUCHDB
        and include the number here and in commit message(s)  -->
   
   ## Related Pull Requests
   N/A
   <!-- If your changes affects on multiple components in different 
        repositories please list here links to those pull requests.  -->
   
   ## Checklist
   
   - [X] Code is written and works correctly;
   - [X] Changes are covered by tests;
   - [] Documentation reflects the changes;
   - [X] I will not forget to update [rebar.config.script](https://github.com/apache/couchdb/blob/master/rebar.config.script)
         with the correct commit hash once this PR get merged.
   
   No documentation change since the changed behavior is aligned with statement in document http://docs.couchdb.org/en/2.0.0/api/document/attachments.html#delete--db-docid-attname
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services