From 2cdb010cfff33c1538c71fb27fc8aaa0dfed4aa4 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 12 Jan 2018 14:17:10 +0000 Subject: [PATCH] Fix lint --- src/crypto/DeviceList.js | 6 +++++- src/crypto/index.js | 3 ++- src/crypto/store/indexeddb-crypto-store.js | 5 ++++- src/sync.js | 10 ++++++---- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/crypto/DeviceList.js b/src/crypto/DeviceList.js index ec6cb2a11..1a213a416 100644 --- a/src/crypto/DeviceList.js +++ b/src/crypto/DeviceList.js @@ -100,7 +100,8 @@ export default class DeviceList { 'readonly', [IndexedDBCryptoStore.STORE_DEVICE_DATA], (txn) => { this._cryptoStore.getEndToEndDeviceData(txn, (deviceData) => { this._devices = deviceData ? deviceData.devices : {}, - this._deviceTrackingStatus = deviceData ? deviceData.trackingStatus : {}; + this._deviceTrackingStatus = deviceData ? + deviceData.trackingStatus : {}; this._syncToken = deviceData ? deviceData.syncToken : null; }); }, @@ -327,6 +328,9 @@ export default class DeviceList { /** * Replaces the list of devices for a user with the given device list + * + * @param {string} u The user ID + * @param {Object} devs New device info for user */ storeDevicesForUser(u, devs) { this._devices[u] = devs; diff --git a/src/crypto/index.js b/src/crypto/index.js index d77b3e522..3a8b05d09 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -812,7 +812,8 @@ Crypto.prototype.decryptEvent = function(event) { * Handle the notification from /sync or /keys/changes that device lists have * been changed. * - * @param {Object} deviceLists device_lists field from /sync, or response from + * @param {Object} syncData Object containing sync tokens associated with this sync + * @param {Object} syncDeviceLists device_lists field from /sync, or response from * /keys/changes */ Crypto.prototype.handleDeviceListChanges = async function(syncData, syncDeviceLists) { diff --git a/src/crypto/store/indexeddb-crypto-store.js b/src/crypto/store/indexeddb-crypto-store.js index e9522fbd6..a4c76f03d 100644 --- a/src/crypto/store/indexeddb-crypto-store.js +++ b/src/crypto/store/indexeddb-crypto-store.js @@ -368,6 +368,7 @@ export default class IndexedDBCryptoStore { * is always consistent, so they are stored in one object. * * @param {Object} deviceData + * @param {*} txn An active transaction. See doTxn(). */ storeEndToEndDeviceData(deviceData, txn) { this._backendPromise.value().storeEndToEndDeviceData(deviceData, txn); @@ -377,9 +378,11 @@ export default class IndexedDBCryptoStore { * Get the state of all tracked devices * * @param {*} txn An active transaction. See doTxn(). + * @param {function(Object)} func Function called with the + * device data */ getEndToEndDeviceData(txn, func) { - return this._backendPromise.value().getEndToEndDeviceData(txn, func); + this._backendPromise.value().getEndToEndDeviceData(txn, func); } /** diff --git a/src/sync.js b/src/sync.js index c20b8e85f..90973237c 100644 --- a/src/sync.js +++ b/src/sync.js @@ -702,8 +702,7 @@ SyncApi.prototype._onSyncError = function(err, syncOptions) { * Process data returned from a sync response and propagate it * into the model objects * - * @param {string} syncToken the old next_batch token sent to this - * sync request. + * @param {Object} syncEventData Object containing sync tokens associated with this sync * @param {Object} data The response from /sync * @param {bool} isCachedResponse True if this response is from our local cache */ @@ -950,7 +949,8 @@ SyncApi.prototype._processSyncResponse = async function( self._deregisterStateListeners(room); room.resetLiveTimeline( joinObj.timeline.prev_batch, - self.opts.canResetEntireTimeline(room.roomId) ? null : syncEventData.oldSyncToken, + self.opts.canResetEntireTimeline(room.roomId) ? + null : syncEventData.oldSyncToken, ); // We have to assume any gap in any timeline is @@ -1046,7 +1046,9 @@ SyncApi.prototype._processSyncResponse = async function( // Handle device list updates if (data.device_lists) { if (this.opts.crypto) { - await this.opts.crypto.handleDeviceListChanges(syncEventData, data.device_lists); + await this.opts.crypto.handleDeviceListChanges( + syncEventData, data.device_lists, + ); } else { // FIXME if we *don't* have a crypto module, we still need to // invalidate the device lists. But that would require a