-
Notifications
You must be signed in to change notification settings - Fork 29
Added event cache #445
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
base: main
Are you sure you want to change the base?
Added event cache #445
Conversation
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.
What are the performance problems you're referring to? Can you elaborate on that?
Also, I'm confused, because I thought the SDK did not fully support saving/restoring the event cache to/from disk. I asked about this previously but I think you might have missed it. Last I heard, the SDK implementation of event caching was not complete; is it fully working yet?
Finally, Robrix currently assumes that there will not be any existing timeline content when syncing and displaying rooms. What happens now that we restore old timeline content to each room? At a minimum, we'll encounter the problem of needing to support forward pagination, because there will very likely be a gap between the old events from the event cache and the newest events fetched via sliding sync. We don't have a way to handle that yet.
.sqlite_store(client_session.db_path, Some(&client_session.passphrase)) | ||
.sliding_sync_version_builder(VersionBuilder::DiscoverNative) |
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.
we also need this, otherwise the client won't attempt to use sliding sync.
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.
Fixed, Saved sliding_sync_version into persistent session. Added "client.set_sliding_sync_version" in restoring_session.
…gination after reconnection
Added Forward pagination after internet reconnection. |
I appreciate that, but .... it's not that simple. First, the code you added will unconditionally run forward pagination on all rooms in the entire client. We never want to do that, as a user might have thousands of rooms, the vast majority of which will not be opened by them. Doing something like that would be incredibly wasteful of CPU, memory, disk, and network resources on both the client and server. Second, and most importantly, we need significant infrastructure across multiple parts of Robrix in order to be able to handle forward pagination correctly. All of the pagination-related code we have thus far assumes only backwards pagination, so running a forward pagination request will not work as well as you expect. For example, we don't efficiently handle the case of merging in new items from a recent forward-pagination request into the existing timeline. We also don't have a way to represent that a timeline may have a gap of missing events at any point within it, rather than just before it's current starting point. There are many other cases that we also have to consider beyond these. This requires serious modifications/improvements to Robrix's code. I would suggest that we pause work on enabling the event cache until those tasks are complete. |
Fixes #442, #435
Allows displaying of offline cached messages and room list.
Tested: