1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Add more comments

This commit is contained in:
David Baker
2018-01-18 17:32:47 +00:00
parent 8b649cec8d
commit 074cfb7c58
2 changed files with 8 additions and 2 deletions

View File

@@ -150,6 +150,8 @@ export default class DeviceList {
if (!this._dirty) return Promise.resolve(false);
if (this._savePromise === null) {
// Delay saves for a bit so we can aggregate multiple saves that happen
// in quick succession (eg. when a whole room's devices are marked as known)
this._savePromise = Promise.delay(500).then(() => {
console.log('Saving device tracking data at token ' + this._syncToken);
return this._cryptoStore.doTxn(
@@ -172,7 +174,7 @@ export default class DeviceList {
}
/**
* Gets the current sync token
* Gets the sync token last set with setSyncToken
*
* @return {string} The sync token
*/
@@ -181,7 +183,8 @@ export default class DeviceList {
}
/**
* Sets the current sync token
* Sets the sync token that the app will pass as the 'since' to the /sync
* endpoint next time it syncs.
* The sync token must always be set after any changes made as a result of
* data in that sync since setting the sync token to a newer one will mean
* those changed will not be synced from the server if a new client starts

View File

@@ -954,6 +954,9 @@ Crypto.prototype._evalDeviceListChanges = async function(deviceLists) {
}
if (deviceLists.left && Array.isArray(deviceLists.left)) {
// Check we really don't share any rooms with these users
// any more: the server isn't required to give us the
// exact correct set.
const e2eUserIds = new Set(this._getE2eUsers());
deviceLists.left.forEach((u) => {