You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/09/01 20:26:45 UTC

[GitHub] [couchdb] davisp commented on a change in pull request #3123: Allow creating new deleted documents

davisp commented on a change in pull request #3123:
URL: https://github.com/apache/couchdb/pull/3123#discussion_r481410760



##########
File path: src/fabric/test/fabric2_doc_crud_tests.erl
##########
@@ -449,12 +449,19 @@ conflict_on_update_with_no_rev({Db, _}) ->
     ?assertThrow(conflict, fabric2_db:update_doc(Db, Doc2)).
 
 
-conflict_on_create_as_deleted({Db, _}) ->
+allow_create_new_as_deleted({Db, _}) ->
     Doc = #doc{
         id = fabric2_util:uuid(),
         deleted = true,
         body = {[{<<"foo">>, <<"bar">>}]}
     },
+    {ok, {1, Rev}} = fabric2_db:update_doc(Db, Doc),
+    ?assertEqual({not_found, deleted}, fabric2_db:open_doc(Db, Doc#doc.id)),
+    Doc1 = Doc#doc{
+        revs = {1, [Rev]}
+    },
+    ?assertEqual({ok, Doc1}, fabric2_db:open_doc(Db, Doc#doc.id, [deleted])),
+    % Only works for new deleted documents

Review comment:
       Minor nit, but how about "Only works when the document has never existed to match CouchDB 3.x behavior"




----------------------------------------------------------------
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:
users@infra.apache.org