You've already forked matrix-js-sdk
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:
@@ -150,6 +150,8 @@ export default class DeviceList {
|
|||||||
if (!this._dirty) return Promise.resolve(false);
|
if (!this._dirty) return Promise.resolve(false);
|
||||||
|
|
||||||
if (this._savePromise === null) {
|
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(() => {
|
this._savePromise = Promise.delay(500).then(() => {
|
||||||
console.log('Saving device tracking data at token ' + this._syncToken);
|
console.log('Saving device tracking data at token ' + this._syncToken);
|
||||||
return this._cryptoStore.doTxn(
|
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
|
* @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
|
* 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
|
* 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
|
* those changed will not be synced from the server if a new client starts
|
||||||
|
|||||||
@@ -954,6 +954,9 @@ Crypto.prototype._evalDeviceListChanges = async function(deviceLists) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (deviceLists.left && Array.isArray(deviceLists.left)) {
|
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());
|
const e2eUserIds = new Set(this._getE2eUsers());
|
||||||
|
|
||||||
deviceLists.left.forEach((u) => {
|
deviceLists.left.forEach((u) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user