Skip to content

Commit 409fbe9

Browse files
committed
fixup! fix(recovery): Delete the known secrets from 4s when disabling recovery
1 parent c6fdf0d commit 409fbe9

File tree

1 file changed

+20
-6
lines changed
  • testing/matrix-sdk-integration-testing/src/tests

1 file changed

+20
-6
lines changed

testing/matrix-sdk-integration-testing/src/tests/e2ee.rs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
use std::sync::{Arc, Mutex};
1+
use std::{
2+
sync::{Arc, Mutex},
3+
time::Duration,
4+
};
25

36
use anyhow::Result;
47
use assert_matches::assert_matches;
@@ -27,6 +30,7 @@ use matrix_sdk::{
2730
EventContentFromType, GlobalAccountDataEventType, OriginalSyncMessageLikeEvent,
2831
},
2932
},
33+
timeout::timeout,
3034
Client,
3135
};
3236
use serde_json::value::to_raw_value;
@@ -1064,12 +1068,22 @@ async fn test_recovery_disabling_deletes_secret_storage_secrets() -> Result<()>
10641068
}
10651069

10661070
debug!("Checking that the info about the default key has been deleted");
1071+
10671072
let event_type = GlobalAccountDataEventType::SecretStorageKey(key_id);
1068-
let content = client
1069-
.account()
1070-
.fetch_account_data(event_type.clone())
1071-
.await?
1072-
.expect("The key event should be available on the server");
1073+
1074+
let get_key_content = async {
1075+
loop {
1076+
if let Ok(Some(content)) = client.account().fetch_account_data(event_type.clone()).await
1077+
{
1078+
return Some(content);
1079+
}
1080+
}
1081+
};
1082+
1083+
let content = timeout(get_key_content, Duration::from_millis(500))
1084+
.await
1085+
.expect("We should be able to fetch the key content")
1086+
.unwrap();
10731087

10741088
SecretStorageKeyEventContent::from_parts(
10751089
&event_type.to_string(),

0 commit comments

Comments
 (0)