[open-ils-commits] [GIT] Evergreen ILS branch master updated. 109add76520e7c2dbd2530700f91d3d7e5797e23

Evergreen Git git at git.evergreen-ils.org
Sun Jul 12 11:33:05 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, master has been updated
       via  109add76520e7c2dbd2530700f91d3d7e5797e23 (commit)
      from  ce7970d35f44930f5126591aee1f3d9673037fc1 (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 109add76520e7c2dbd2530700f91d3d7e5797e23
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