validation function failures do not stop _update document creation
------------------------------------------------------------------

                 Key: COUCHDB-692
                 URL: https://issues.apache.org/jira/browse/COUCHDB-692
             Project: CouchDB
          Issue Type: Bug
            Reporter: mikeal
            Priority: Critical


I noticed a pretty serious bug working on js-registry.

"updates" : { "package", "function (doc, req) { return [{forbidden:\"cannot use 
this\", \"_id\":\"bad\"}, \"cannot use this\"] }" }, 
"validate_update_doc" : "function (newDoc, oldDoc, user) { if 
(newDoc.forbidden) { throw "this should fail" } "

What this should do is block the creation of the newDoc, but it doesn't, a new 
document with _id = "bad" is created. Even worse, if you don't have a doc id a 
document with an empty id is created.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to