-
-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy loading: Lazy load members while backpaginating #676
Lazy loading: Lazy load members while backpaginating #676
Conversation
This works with rooms which haven't had their members loaded yet.
…mary heroes/counts.
we need more than just a filter, which is what is passed in now, so have an explicit option. For now still take the filter but later on this could be created inside MatrixClient
so we only need to add LL filter once
…uding event context for now)
As RoomMember contains the event in a nested object (events.member), a shallow copy was not enough to be immutable. This solution won't copy OOB flags but that's not neccesary for sentinels.
applying itself all the way till the next member event when back paginating
f04ca93
to
5b79cc2
Compare
|
As we need an option to turn lazy loading on (we can't just accept a filter, as /messages has an incompatible filter), better only pass the option and create the filter inside startClient
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.
otherwise I think this looks good!
src/models/room-state.js
Outdated
* of the chunk can be set with this method. | ||
* @param {MatrixEvent[]} events state events to prepend | ||
*/ | ||
RoomState.prototype.prependStateEvents = function(events) { |
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.
isn't this just setUnknownStateEvents
? I'm not sure what is actually 'prepend'-y about it
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.
The idea was that it inserts the state events as if they came before the state already present, hence prepend. But you're right, setUnknownStateEvents makes more sense.
*/ | ||
MatrixClient.prototype.startClient = function(opts) { | ||
MatrixClient.prototype.startClient = async function(opts) { |
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.
Hmm - in terms of backwards compat, what will happen if a client doesn't wait on this promise and starts calling API methods immediately?
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.
Good point. MatrixClient::_syncApi
wouldn't be set yet, which could have some side-effects:
getSyncState
returning nullstartClient
twice could leave you with two runningSyncApi
sstopClient
wouldn't stop the syncretryImmediately
would crash
Hmm, I guess this could be a breaking change then, and hence if we want to do it carry a major version number change.
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.
Maybe I just keep the filter creation inside MatrixClientPeg then?
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.
(out of band: let's do a version bump)
Based on #677
Add RoomState to EventContextFix MessagePanel::_getReadMarkerGhostTile generating double keys