[open-ils-commits] [GIT] Evergreen ILS branch rel_3_5 updated. d637584c4ac9d2b6d381b41e2f580cdb590cd329

Evergreen Git git at git.evergreen-ils.org
Sun Jul 12 11:33:33 EDT 2020


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_3_5 has been updated
       via  d637584c4ac9d2b6d381b41e2f580cdb590cd329 (commit)
      from  4062a68ccfcff1893ac5f2ec735ca40718ee3f4b (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 d637584c4ac9d2b6d381b41e2f580cdb590cd329
Author: Jason Boyer <JBoyer at eoli.info>
Date:   Fri Feb 21 16:08:36 2020 -0500

    LP1864056: Don't compare multiple new Date()s
    
    This branch addresses a race condition when
    checking out or renewing items.
    (The use of minDate in items_out was implicitly
    immune to this issue, but that is made explicit
    with this patch.)
    
    To test
    -------
    [1] The race condition would be difficult to reliably
        reproduce directly, although a tool like
        https://github.com/mattzeunert/javascript-clock-speedup
        might help simulate the problem, so to test, verify
        that the following actions do not break:
    
        * checking out a loan, both with and without
          setting a specific due date
        * renewing a loan with a specific due date
          from the patron items out tab
        * renewing a loan from Circulation -> Renew Items,
          both with and without setting a specific due date.
    
    Signed-off-by: Jason Boyer <JBoyer at eoli.info>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>

diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
index 95105465bf..df4945bfbb 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
@@ -9,6 +9,7 @@ angular.module('egPatronApp').controller('PatronCheckoutCtrl',
 
 function($scope , $q , $routeParams , egCore , egUser , patronSvc , 
          egGridDataProvider , $location , $timeout , egCirc , ngToast) {
+    var now = new Date();
 
     $scope.initTab('checkout', $routeParams.id).finally(function(){
         $scope.focusMe = true;
@@ -16,10 +17,10 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
     $scope.checkouts = patronSvc.checkouts;
     $scope.checkoutArgs = {
         noncat_type : 'barcode',
-        due_date : new Date()
+        due_date : new Date(now)
     };
 
-    $scope.minDate = new Date();
+    $scope.minDate = new Date(now);
     $scope.outOfRange = false;
     $scope.gridDataProvider = egGridDataProvider.instance({
         get : function(offset, count) {
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
index 26341c1844..b17702f889 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
@@ -503,11 +503,12 @@ function($scope , $q , $routeParams , $timeout , egCore , egUser , patronSvc ,
             controller : [
                         '$scope','$uibModalInstance',
                 function($scope , $uibModalInstance) {
+                    var now = new Date();
                     $scope.outOfRange = false;
-                    $scope.minDate = new Date();
+                    $scope.minDate = new Date(now);
                     $scope.args = {
                         barcodes : barcodes,
-                        date : new Date()
+                        date : new Date(now)
                     }
                     $scope.cancel = function() {$uibModalInstance.dismiss()}
 
diff --git a/Open-ILS/web/js/ui/default/staff/circ/renew/app.js b/Open-ILS/web/js/ui/default/staff/circ/renew/app.js
index b5cdfd194b..95f59ebd2c 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/renew/app.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/renew/app.js
@@ -32,16 +32,16 @@ angular.module('egRenewApp',
 .controller('RenewCtrl',
        ['$scope','$window','$location','egCore','egGridDataProvider','egCirc',
 function($scope , $window , $location , egCore , egGridDataProvider , egCirc) {
+    var now = new Date();
 
     egCore.hatch.getItem('circ.renew.strict_barcode')
         .then(function(sb){ $scope.strict_barcode = sb });
     $scope.focusBarcode = true;
     $scope.outOfRange = false;
-    $scope.minDate = new Date();
+    $scope.minDate = new Date(now);
     $scope.renewals = [];
 
-    var today = new Date();
-    $scope.renewalArgs = {due_date : today};
+    $scope.renewalArgs = {due_date : new Date(now)};
 
     $scope.sort_money = function (a,b) {
         var ma = parseFloat(a);

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

Summary of changes:
 Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js  | 5 +++--
 Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js | 5 +++--
 Open-ILS/web/js/ui/default/staff/circ/renew/app.js        | 6 +++---
 3 files changed, 9 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list