Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 88337 invoked from network); 12 Mar 2010 19:07:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Mar 2010 19:07:27 -0000 Received: (qmail 97604 invoked by uid 500); 12 Mar 2010 19:06:49 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 97496 invoked by uid 500); 12 Mar 2010 19:06:49 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 97368 invoked by uid 99); 12 Mar 2010 19:06:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Mar 2010 19:06:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Mar 2010 19:06:47 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 50DBE234C4CB for ; Fri, 12 Mar 2010 19:06:27 +0000 (UTC) Message-ID: <1113735450.232451268420787330.JavaMail.jira@brutus.apache.org> Date: Fri, 12 Mar 2010 19:06:27 +0000 (UTC) From: "mikeal (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Created: (COUCHDB-692) validation function failures do not stop _update document creation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 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.