forked from mystiq/hydrogen-web
add some comments while debugging a problem
This commit is contained in:
parent
e49639fda2
commit
e515548037
3 changed files with 9 additions and 1 deletions
|
@ -287,7 +287,7 @@ export class Session {
|
|||
}
|
||||
|
||||
/**
|
||||
* @internal called when coming back online
|
||||
* @internal called from session container when coming back online and catchup syncs have finished.
|
||||
* @param {Object} lastVersionResponse a response from /versions, which is polled while offline,
|
||||
* and useful to store so we can later tell what capabilities
|
||||
* our homeserver has.
|
||||
|
|
|
@ -45,6 +45,13 @@ export class DeviceTracker {
|
|||
|
||||
async writeDeviceChanges(deviceLists, txn) {
|
||||
const {userIdentities} = txn;
|
||||
// TODO: should we also look at left here to handle this?:
|
||||
// the usual problem here is that you share a room with a user,
|
||||
// go offline, the remote user leaves the room, changes their devices,
|
||||
// then rejoins the room you share (or another room).
|
||||
// At which point you come online, all of this happens in the gap,
|
||||
// and you don't notice that they ever left,
|
||||
// and so the client doesn't invalidate their device cache for the user
|
||||
if (Array.isArray(deviceLists.changed) && deviceLists.changed.length) {
|
||||
await Promise.all(deviceLists.changed.map(async userId => {
|
||||
const user = await userIdentities.get(userId);
|
||||
|
|
|
@ -121,6 +121,7 @@ export class Transaction {
|
|||
}
|
||||
|
||||
abort() {
|
||||
// TODO: should we wrap the exception in a StorageError?
|
||||
this._txn.abort();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue