Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Update roomlist when an event is decrypted #1380

Merged
merged 1 commit into from
Sep 12, 2017

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Sep 12, 2017

Events are now decrypted asynchronously, so are not decrypted
at the time of the Room.timeline which is when our RoomList
got the chance to update. It needs to update once the event has
been decrypted.

Ideally we would not update the whole room list order, but this is
how all the room list re-ordering happens right now, so staying
consistent with this.

Fixes element-hq/element-web#5020

Events are now decrypted asynchronously, so are not decrypted
at the time of the Room.timeline which is when our RoomList
got the chance to update. It needs to update once the event has
been decrypted.

Ideally we would not update the whole room list order, but this is
how all the room list re-ordering happens right now, so staying
consistent with this.

Fixes element-hq/element-web#5020
@ara4n
Copy link
Member

ara4n commented Sep 12, 2017

this feels dangerous. are you sure this isn't going to fire in a tight loop when decrypting initialSyncs?

@ara4n
Copy link
Member

ara4n commented Sep 12, 2017

although i guess the fact the update is delayed stops it from exploding... and presumably there isn't actually a better solution.

lgtm then.

@ara4n ara4n assigned dbkr and unassigned ara4n Sep 12, 2017
@dbkr
Copy link
Member Author

dbkr commented Sep 12, 2017

I think we will get one of these for every event decrypted when, for example, we get a key from a different device as a result of a key request, but the updates are rate-limited so are designed to handle being called in a tight loop (as they are in other situations, eg. when a bunch of events arrive on the end of the timeline from a catchup sync). This is basically just how the js-sdk works (ie. doesn't do event batching)

@dbkr dbkr assigned ara4n and unassigned dbkr Sep 12, 2017
@ara4n
Copy link
Member

ara4n commented Sep 12, 2017

lgtm.

@dbkr dbkr merged commit 8ad69ee into develop Sep 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants