From 585ec15946aaee0b13049c1882a2ffaab353a242 Mon Sep 17 00:00:00 2001 From: Daniel Salinas Date: Fri, 17 Jan 2025 10:16:12 -0500 Subject: [PATCH] Fix cross_process tests --- crates/matrix-sdk/src/oidc/cross_process.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/crates/matrix-sdk/src/oidc/cross_process.rs b/crates/matrix-sdk/src/oidc/cross_process.rs index 46936fa27c..130b772ac1 100644 --- a/crates/matrix-sdk/src/oidc/cross_process.rs +++ b/crates/matrix-sdk/src/oidc/cross_process.rs @@ -264,7 +264,9 @@ mod tests { use super::compute_session_hash; use crate::{ - authentication::{ReloadSessionCallback, SaveSessionCallback, SessionCallbackError}, + authentication::{ + ReloadSessionCallback, SaveSessionCallback, SessionCallbackError, SessionTokens, + }, oidc::{ backend::mock::{MockImpl, ISSUER_URL}, cross_process::SessionHash, @@ -273,7 +275,7 @@ mod tests { Oidc, OidcSessionTokens, }, test_utils::test_client_builder, - Error, + Client, Error, }; struct TestReloadSessionCallback { @@ -284,7 +286,7 @@ mod tests { impl ReloadSessionCallback for TestReloadSessionCallback { async fn reload_session( &self, - client: matrix_sdk::Client, + client: Client, ) -> Result { crate::authentication::SessionTokens::Oidc(self.tokens.clone()) } @@ -294,10 +296,7 @@ mod tests { #[async_trait::async_trait] impl SaveSessionCallback for TestSaveSessionCallback { - async fn save_session( - &self, - client: matrix_sdk::Client, - ) -> Result<(), SessionCallbackError> { + async fn save_session(&self, client: Client) -> Result<(), SessionCallbackError> { panic!("save_session_callback shouldn't be called here") } } @@ -577,7 +576,7 @@ mod tests { } client.set_session_callbacks( - Box::new(TestReloadSessionCallback { tokens: next_tokens }), + Box::new(TestReloadSessionCallback { tokens: next_tokens.clone() }), Box::new(TestSaveSessionCallback {}), )?;