couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [26/50] [abbrv] git commit: Add artificial delay to admin-creation to work around WebKit
Date Wed, 14 Mar 2012 22:28:01 GMT
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/5c52fda5
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/5c52fda5
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/5c52fda5

Branch: refs/heads/COUCHDB-1426
Commit: 5c52fda540fbdf2eb65e32f94c7df3e0bdd7fc08
Parents: dce0c28
Author: Jan Lehnardt <jan@apache.org>
Authored: Mon Feb 13 12:57:13 2012 +0100
Committer: Jan Lehnardt <jan@apache.org>
Committed: Mon Feb 13 12:57:13 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/5c52fda5/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);
         }


Mime
View raw message