[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch rel_2_5 updated. 6e9fd31cdd3cd9a8f38fda9c8d2bdd082e1c34d4

Evergreen Git git at git.evergreen-ils.org
Fri Oct 10 15:06:09 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_5 has been updated
       via  6e9fd31cdd3cd9a8f38fda9c8d2bdd082e1c34d4 (commit)
      from  0fa5d67e9ecdd6e8261b100c70c2cab5f6289d55 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6e9fd31cdd3cd9a8f38fda9c8d2bdd082e1c34d4
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Thu Oct 9 17:32:42 2014 -0400

    LP#1379824 Make PermaCrud.js disconnect() actually disconnect
    
    The disconnect() method in PermaCrud.js was meant to wrap the
    underlying session disconnect, but it never actually disconnected
    the session.  This could lead to problems in long-living PermaCrud
    objects, as they may think they are still connected when they are not
    (the session remote_id is never cleared).
    
    Also, remove a couple (now redundant) manual session.disconnect() calls.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Yamil Suarez <yamil at yamil.com>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/web/js/dojo/openils/PermaCrud.js b/Open-ILS/web/js/dojo/openils/PermaCrud.js
index c284c65..2df2fa1 100644
--- a/Open-ILS/web/js/dojo/openils/PermaCrud.js
+++ b/Open-ILS/web/js/dojo/openils/PermaCrud.js
@@ -60,13 +60,11 @@ if(!dojo._hasResource["openils.PermaCrud"]) {
         },
 
         disconnect : function ( onerror ) {
+            // session.disconnect() does not return any indication of success,
+            // so we must simply assume it worked
+            this.session.disconnect();
             this.connected = false;
             return true;
-            // disconnect returns nothing, which is null, which is not true, cause the following to always run ... arg.
-            if (!this.session.disconnect()) {
-                if (onerror) onerror(this.session);
-                return false;
-            }
         },
 
         _session_request : function ( args /* hash */, commitOnComplete /* set to true, else no */ ) {
@@ -82,7 +80,6 @@ if(!dojo._hasResource["openils.PermaCrud"]) {
                 if (args.timeout && !args.oncomplete && !args.onresponse) { // pure sync call
                     args.oncomplete = function (r) {
                         me.session.request('open-ils.pcrud.transaction.' + endstyle, me.auth());
-                        me.session.disconnect();
                         me.disconnect();
                     };
                 } else if (args.oncomplete) { // there's an oncomplete, fire that, and then end the transaction
@@ -93,7 +90,6 @@ if(!dojo._hasResource["openils.PermaCrud"]) {
                             ret = orig_oncomplete(r);
                         } finally {
                             me.session.request('open-ils.pcrud.transaction.' + endstyle, me.auth());
-                            me.session.disconnect();
                             me.disconnect();
                         }
                         return ret;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/js/dojo/openils/PermaCrud.js |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list