From 66e2b3bb70e5131978f78bbdb179e22d12ed949f Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 7 Mar 2018 17:32:51 +0000 Subject: [PATCH] Don't mark devicelist dirty unnecessarily This was marking the device list as dirty even when nothing had actually changed, causing unnecessary saves. --- src/crypto/DeviceList.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/crypto/DeviceList.js b/src/crypto/DeviceList.js index d913b426a..4263b39e9 100644 --- a/src/crypto/DeviceList.js +++ b/src/crypto/DeviceList.js @@ -418,11 +418,11 @@ export default class DeviceList { if (this._deviceTrackingStatus[userId]) { console.log('No longer tracking device list for ' + userId); this._deviceTrackingStatus[userId] = TRACKING_STATUS_NOT_TRACKED; - } - // we don't yet persist the tracking status, since there may be a lot - // of calls; we save all data together once the sync is done - this._dirty = true; + // we don't yet persist the tracking status, since there may be a lot + // of calls; we save all data together once the sync is done + this._dirty = true; + } } /** @@ -453,11 +453,11 @@ export default class DeviceList { if (this._deviceTrackingStatus[userId]) { console.log("Marking device list outdated for", userId); this._deviceTrackingStatus[userId] = TRACKING_STATUS_PENDING_DOWNLOAD; - } - // we don't yet persist the tracking status, since there may be a lot - // of calls; we save all data together once the sync is done - this._dirty = true; + // we don't yet persist the tracking status, since there may be a lot + // of calls; we save all data together once the sync is done + this._dirty = true; + } } /**