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

Persistent app data on disk storage #112

Closed
kevinaboos opened this issue Aug 19, 2024 · 0 comments · Fixed by #149
Closed

Persistent app data on disk storage #112

kevinaboos opened this issue Aug 19, 2024 · 0 comments · Fixed by #149
Assignees

Comments

@kevinaboos
Copy link
Member

kevinaboos commented Aug 19, 2024

Currently Robrix does not save any app state to persistent storage. Thus, all data displayed by Robrix must be re-fetched from scratch every time the app is started. Obviously this is not suitable for a real usable app that would be installed on actual user devices.

In the Moxin app, I used the directories crate to store persistent application data to (and read it back from) the canonical directories for app data, cached data, preferences/settings/config data, etc. See the PR here: moxin-org/moly#96

The ability to save and restore Matrix SDK state is required for properly handling login tokens (sessions), E2EE tokens

Unknowns

One complication is that the Matrix SDK itself wants to implicitly handle saving and restoring its internal state (e.g., timeline content, etc).
So we don't necessarily have full direct control over all states that are persisted to storage.

I'm not sure what internal states that the Matrix SDK Client manages (and other session data) are capable of being saved/restored to disk. Furthermore, I'm not sure which Matrix SDK APIs should be used to actually trigger the saving or restoring action. Things are a bit opaque and not well documented.

Examples

Thankfully, the Matrix SDK does provide one example of how to persist internal session data.
https://github.com/matrix-org/matrix-rust-sdk/blob/main/examples/persist_session/src/main.rs

This should provide a good baseline for where to start on implementing app data persistence.

@github-project-automation github-project-automation bot moved this to Ready in Robrix Aug 19, 2024
@kevinaboos kevinaboos changed the title Persistent app data to/from disk storage Persistent app data on disk storage Aug 19, 2024
@kevinaboos kevinaboos self-assigned this Sep 18, 2024
@kevinaboos kevinaboos moved this from Ready to In progress in Robrix Sep 18, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Robrix Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant