From a6325b5b51eee5d5ffd20e1d8ed73f5327854435 Mon Sep 17 00:00:00 2001 From: Christine Spang Date: Sat, 14 Jan 2017 13:34:31 -0800 Subject: [PATCH] fix(sync-status): Update how we calculate sync status Summary: Concommitant diff to D3677 Test Plan: manual Reviewers: halla, juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D3678 --- src/K2 | 2 +- src/flux/stores/nylas-sync-status-store.es6 | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/K2 b/src/K2 index 44f8bf062..387d68941 160000 --- a/src/K2 +++ b/src/K2 @@ -1 +1 @@ -Subproject commit 44f8bf0627a4a3bfa1378bcc322967af6692f711 +Subproject commit 387d6894159376f5aecc6216ab451f4594ee48e8 diff --git a/src/flux/stores/nylas-sync-status-store.es6 b/src/flux/stores/nylas-sync-status-store.es6 index 3ec7253ae..09dde67d4 100644 --- a/src/flux/stores/nylas-sync-status-store.es6 +++ b/src/flux/stores/nylas-sync-status-store.es6 @@ -95,9 +95,11 @@ class NylasSyncStatusStore extends NylasStore { const updates = {} for (const folder of folders) { const name = folder.name || folder.displayName - const {uidnext, fetchedmin, fetchedmax, oldestProcessedDate} = folder.syncState || {} + const {uidnext, fetchedmin, fetchedmax, minUID, oldestProcessedDate} = folder.syncState || {} if (uidnext) { - const progress = (+fetchedmax - +fetchedmin + 1) / uidnext + // TODO: when we unify the databases, we shouldn't need code to + // calculate this in two different places anymore + const progress = (+minUID + (+fetchedmax - +fetchedmin) + 1) / uidnext updates[name] = { progress, total: uidnext,