Skip to content
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

Save and restore event cache to/from persistent storage #164

Open
kevinaboos opened this issue Sep 26, 2024 · 2 comments · May be fixed by #419
Open

Save and restore event cache to/from persistent storage #164

kevinaboos opened this issue Sep 26, 2024 · 2 comments · May be fixed by #419
Assignees

Comments

@kevinaboos
Copy link
Member

Now that a user's login session is properly persisted to/from storage on all platforms, the next step is to:

  1. Serialize the actual set of all timeline events (as a list of SyncTimelineEvents) upon app exit, or perhaps upon another lifecycle stage.
  2. Deserialize them and repopulate the event cache before synchronizing any timelines, using the EventCache::add_initial_events()
    • We just removed an erroneous invocation of this function in fde5d29
@github-project-automation github-project-automation bot moved this to Ready in Robrix Sep 26, 2024
@kevinaboos kevinaboos added the blocked Blocked on another issue or missing feature label Nov 11, 2024
@kevinaboos
Copy link
Member Author

This is blocked on the Matrix Rust SDK, which currently doesn't fully implement EventCache features that allow the client to customize how events are extracted from and imported into the cache.

@kevinaboos kevinaboos moved this from Ready to Blocked in Robrix Nov 11, 2024
@kevinaboos
Copy link
Member Author

kevinaboos commented Jan 15, 2025

Hmm, actually it appears that the SDK might support this, at least in part, by using the ClientBuilder to configure a client to use an existing state store and cache path.

https://matrix-org.github.io/matrix-rust-sdk/matrix_sdk/struct.ClientBuilder.html#method.sqlite_store_with_cache_path

However, that being said, I haven't tried it yet and am not sure if pointing a Client at an existing database & cache in the filesystem will actually cause the SDK to pull in those old events into the Client's EventCache or have them initially populate the rooms & timelines.

@kevinaboos kevinaboos removed the blocked Blocked on another issue or missing feature label Jan 15, 2025
@alanpoon alanpoon self-assigned this Mar 4, 2025
@alanpoon alanpoon linked a pull request Mar 4, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Blocked
Development

Successfully merging a pull request may close this issue.

2 participants