Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 923E59E2E for ; Mon, 13 Feb 2012 12:01:04 +0000 (UTC) Received: (qmail 36018 invoked by uid 500); 13 Feb 2012 12:01:04 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 35778 invoked by uid 500); 13 Feb 2012 12:01:04 -0000 Mailing-List: contact commits-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 commits@couchdb.apache.org Received: (qmail 35763 invoked by uid 99); 13 Feb 2012 12:01:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Feb 2012 12:01:03 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.114] (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Feb 2012 12:01:01 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A892931F98E; Mon, 13 Feb 2012 12:00:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jan@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: Add artificial delay to admin-creation to work around WebKit Message-Id: <20120213120040.A892931F98E@tyr.zones.apache.org> Date: Mon, 13 Feb 2012 12:00:40 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Updated Branches: refs/heads/master 597de1b99 -> 32a67c196 Add artificial delay to admin-creation to work around WebKit WebKit browsers seem to execute the success callback too fast for CouchDB to complete the _config PUT for creating admins. We'll be waiting for 200ms to let CouchDB catch up. Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/32a67c19 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/32a67c19 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/32a67c19 Branch: refs/heads/master Commit: 32a67c196da989dd79e2c771258af91b5297db26 Parents: 20e6ffc Author: Jan Lehnardt Authored: Mon Feb 13 12:57:13 2012 +0100 Committer: Jan Lehnardt Committed: Mon Feb 13 13:00:31 2012 +0100 ---------------------------------------------------------------------- share/www/script/futon.js | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/32a67c19/share/www/script/futon.js ---------------------------------------------------------------------- diff --git a/share/www/script/futon.js b/share/www/script/futon.js index e32e14e..a82269d 100644 --- a/share/www/script/futon.js +++ b/share/www/script/futon.js @@ -85,19 +85,21 @@ function $$(node) { if (!validateUsernameAndPassword(data, callback)) return; $.couch.config({ success : function() { - doLogin(data.name, data.password, function(errors) { - if(!$.isEmptyObject(errors)) { - callback(errors); - return; - } - doSignup(data.name, null, function(errors) { - if (errors && errors.name && errors.name.indexOf && errors.name.indexOf("taken") == -1) { + setTimeout(function() { + doLogin(data.name, data.password, function(errors) { + if(!$.isEmptyObject(errors)) { callback(errors); - } else { - callback(); + return; } - }, false); - }); + doSignup(data.name, null, function(errors) { + if (errors && errors.name && errors.name.indexOf && errors.name.indexOf("taken") == -1) { + callback(errors); + } else { + callback(); + } + }, false); + }); + }, 200); } }, "admins", data.name, data.password); }