From 0aa96db2e531b48857d2d152dc08b29f7bcee660 Mon Sep 17 00:00:00 2001
From: cgeek <cem.moreau@gmail.com>
Date: Tue, 7 Nov 2017 18:54:28 +0100
Subject: [PATCH] [fix] #1168 Quick sync does not updates correctly the index

---
 app/lib/computation/QuickSync.ts | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/app/lib/computation/QuickSync.ts b/app/lib/computation/QuickSync.ts
index ccdeac10a..db385418a 100644
--- a/app/lib/computation/QuickSync.ts
+++ b/app/lib/computation/QuickSync.ts
@@ -126,8 +126,11 @@ export class QuickSynchronizer {
 
         // Remember expiration dates
         for (const entry of index) {
-          if (entry.expires_on || entry.revokes_on) {
-            sync_expires.push(entry.expires_on || entry.revokes_on);
+          if (entry.expires_on) {
+            sync_expires.push(entry.expires_on)
+          }
+          if (entry.revokes_on) {
+            sync_expires.push(entry.revokes_on)
           }
         }
         sync_expires = _.uniq(sync_expires);
@@ -151,8 +154,8 @@ export class QuickSynchronizer {
               i--;
             }
           }
-          let currentNextExpiring = sync_nextExpiring
-          sync_nextExpiring = sync_expires.reduce((max, value) => max ? Math.min(max, value) : value, sync_nextExpiring);
+          const currentNextExpiring = sync_nextExpiring
+          sync_nextExpiring = sync_expires.reduce((max, value) => max ? Math.min(max, value) : value, 9007199254740991); // Far far away date
           const nextExpiringChanged = currentNextExpiring !== sync_nextExpiring
 
           // Fills in correctly the SINDEX
-- 
GitLab