Try to resume backups if we restore the client
This commit is contained in:
@@ -915,6 +915,19 @@ impl Client {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn set_session_meta(&self, session_meta: SessionMeta) -> Result<()> {
|
||||
self.base_client().set_session_meta(session_meta).await?;
|
||||
|
||||
#[cfg(feature = "e2e-encryption")]
|
||||
{
|
||||
if let Err(e) = self.encryption().backups().setup_and_resume().await {
|
||||
error!("Couldn't setup and resume backups {e:?}");
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Refresh the access token using the authentication API used to log into
|
||||
/// this session.
|
||||
///
|
||||
@@ -1955,7 +1968,7 @@ impl Client {
|
||||
// overwrite the session information shared with the parent too, and it
|
||||
// must be initialized at most once.
|
||||
if let Some(session) = self.session() {
|
||||
client.base_client().set_session_meta(session.into_meta()).await?;
|
||||
client.set_session_meta(session.into_meta()).await?;
|
||||
}
|
||||
|
||||
Ok(client)
|
||||
|
||||
@@ -825,7 +825,7 @@ impl MatrixAuth {
|
||||
|
||||
async fn set_session(&self, session: MatrixSession) -> Result<()> {
|
||||
self.set_session_tokens(session.tokens);
|
||||
self.client.base_client().set_session_meta(session.meta).await?;
|
||||
self.client.set_session_meta(session.meta).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -712,7 +712,7 @@ impl Oidc {
|
||||
authorization_data: Default::default(),
|
||||
};
|
||||
|
||||
self.client.base_client().set_session_meta(meta).await?;
|
||||
self.client.set_session_meta(meta).await?;
|
||||
self.deferred_enable_cross_process_refresh_lock().await?;
|
||||
|
||||
self.client
|
||||
@@ -911,7 +911,7 @@ impl Oidc {
|
||||
device_id: whoami_res.device_id.ok_or(OidcError::MissingDeviceId)?,
|
||||
};
|
||||
|
||||
self.client.base_client().set_session_meta(session).await.map_err(crate::Error::from)?;
|
||||
self.client.set_session_meta(session).await.map_err(crate::Error::from)?;
|
||||
// At this point the Olm machine has been set up.
|
||||
|
||||
// Enable the cross-process lock for refreshes, if needs be.
|
||||
|
||||
Reference in New Issue
Block a user