matrix-org / matrix-org/matrix-rust-sdk
Allow `restore_session` without `SessionMeta`
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 500
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 106
Description
It is possible and desirable to be able to restore a session with having `SessionMeta` cached by the client, but instead discovering it via `whoami` during the session restoration. Implementing this seems fairly easy, but what API should be created for this is not clear to me. `MatrixSession` could be modified to make `meta` optional, but I'm not sure this makes sense for other places `MatrixSession` is used.
Here are some options I've though of:
- Make `meta` in `MatrixSession` an option
- Create a new type to replace `MatrixSession` for `restore_session`
- Create a new method on `Client` for this use case
Additionally, what should the client do if `whoami` does not return a device id?
I'd like feedback on how to implement this please.
Contributor guide
Research direction
Start by reviewing the MatrixSession usages and the restore_session and whoami entry points. Compare the proposed optional meta, replacement type, and new Client method approaches, including behavior when whoami returns no device id. Done means an agreed API and defined restoration behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- authentication
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100