matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

Allow `restore_session` without `SessionMeta`

Open gaykitty opened this issue 7 months ago • 1 comments

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.

gaykitty avatar Nov 15 '23 06:11 gaykitty