test: exec_securejoin_qr_multi_device(): Make inviter devices receive each other messages

Otherwise we're testing an abnormal scenario when `Config::BccSelf` ("multi-device") is disabled.
This commit is contained in:
iequidoo
2026-06-12 16:22:44 -03:00
committed by iequidoo
parent 293b524373
commit 15059ad8d7
3 changed files with 15 additions and 4 deletions

View File

@@ -272,6 +272,7 @@ impl TestContextManager {
/// Executes SecureJoin initiated by `joiner`
/// scanning `qr` generated by one of the `inviters` devices.
/// `inviters` devices must have the same primary address.
/// All of the `inviters` devices will get the messages and send replies.
///
/// The [`ChatId`] of the created chat is returned, for a SetupContact QR this is the 1:1
@@ -283,8 +284,10 @@ impl TestContextManager {
qr: &str,
) -> ChatId {
assert!(joiner.pop_sent_msg_opt(Duration::ZERO).await.is_none());
let inviter_addr = inviters[0].get_primary_self_addr().await.unwrap();
for inviter in inviters {
assert!(inviter.pop_sent_msg_opt(Duration::ZERO).await.is_none());
assert_eq!(inviter.get_primary_self_addr().await.unwrap(), inviter_addr);
}
let chat_id = join_securejoin(&joiner.ctx, qr).await.unwrap();
@@ -300,6 +303,14 @@ impl TestContextManager {
}
for inviter in inviters {
if let Some(sent) = inviter.pop_sent_msg_ex(rev_order, Duration::ZERO).await {
if sent.recipients.split(' ').any(|addr| addr == inviter_addr) {
for observer in inviters {
// `imap::prefetch_should_download()` returns false on the sender side.
if observer.get_id() != inviter.get_id() {
observer.recv_msg_opt(&sent).await;
}
}
}
joiner.recv_msg_opt(&sent).await;
something_sent = true;
}