This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Optimise calculating device_list changes in
/sync
. #11974Optimise calculating device_list changes in
/sync
. #11974Changes from 3 commits
d80f315
7ca292e
d5d3f34
4f965f0
e44bd6d
71868b6
32b36e8
211f50e
beb509e
4967247
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may want a little docstring here, mostly for the return type, which is not very obvious.
It's roughly
user → (room, event_pos)
to my reading. What does theevent_pos
mean here?… seems to be the position of the event that gives the user their membership in the room?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have no need to invalidate this if a user leaves or so on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, missed that this didn't have a docstring.
I think you're missing that this is using a
@cachedList
, which means that its simply a batch version ofget_rooms_for_user_with_stream_ordering
and reuses the same cache. Hence why it includes the stream ordering and the like. Also means that invalidation is already taken care of.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh, I see, very cute. That makes sense!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we stuck with this thing until the rest of time? I'm guessing it's some kind of optimisation we came up with that got populated in the background?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point I think we can change it from a background update to happen synchronously? Or require that people upgrade from vX -> vY and then vY -> vZ? I think we've done something along these lines before?