conversation: avoid to get lastCommitId while merging

Change-Id: I2a7b7cc13268be127a6afe3d689d005b6596a3cd
This commit is contained in:
Sébastien Blin
2024-02-28 15:13:00 -05:00
parent 16b77dd10c
commit 36925c0d94
3 changed files with 12 additions and 9 deletions

View File

@ -576,6 +576,8 @@ ConversationMembersEventTest::testAddOfflineMemberThenConnects()
auto aliceMsgSize = aliceData.messages.size();
libjami::addConversationMember(aliceId, convId, carlaUri);
CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&]() { return aliceMsgSize + 1 == aliceData.messages.size(); }));
CPPUNIT_ASSERT(!cv.wait_for(lk, 30s, [&] { return carlaData.requestReceived; }));
Manager::instance().sendRegister(carlaId, true);
CPPUNIT_ASSERT(cv.wait_for(lk, 60s, [&] { return carlaData.requestReceived; }));
@ -929,7 +931,8 @@ ConversationMembersEventTest::testMemberCannotBanOther()
// remove from member & add into banned without voting for the ban
simulateRemoval(carlaAccount, convId, bobUri);
// Note: it may be possible that alice doesn't get the error if they got messages from bob (and bob rejects due to an error)
CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&]() { return aliceData.errorDetected || bobData.errorDetected; }));
CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&]() {
return aliceData.errorDetected || bobData.errorDetected; }));
auto bobMsgSize = bobData.messages.size();
libjami::sendMessage(aliceId, convId, "hi"s, "");
@ -966,7 +969,7 @@ ConversationMembersEventTest::testMemberCannotUnBanOther()
cv.wait_for(lk, 30s, [&]() { return !carlaData.conversationId.empty()
&& aliceData.members[carlaUri] == 1
&& bobData.members[carlaUri] == 1; }));
std::this_thread::sleep_for(3s); // Wait that carla finish the clone
// Now check that alice, has the only admin, can remove bob
libjami::removeConversationMember(aliceId, convId, bobUri);
CPPUNIT_ASSERT(
@ -1443,7 +1446,8 @@ ConversationMembersEventTest::testAvoidTwoOneToOneMultiDevices()
bobAccount->addContact(aliceUri);
bobAccount->sendTrustRequest(aliceUri, {});
CPPUNIT_ASSERT(
cv.wait_for(lk, 30s, [&]() { return bobData.conversationId == aliceData.conversationId && bob2Data.conversationId == aliceData.conversationId; }));
cv.wait_for(lk, 30s, [&]() {
return bobData.conversationId == aliceData.conversationId && bob2Data.conversationId == aliceData.conversationId; }));
}
void
@ -1696,7 +1700,6 @@ ConversationMembersEventTest::testBanFromNewDevice()
CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&]() { return bob2Data.deviceAnnounced; }));
CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&]() { return !bob2Data.conversationId.empty(); }));
auto bobMsgSize = bobData.messages.size();
libjami::removeConversationMember(bob2Id, convId, aliceUri);
CPPUNIT_ASSERT(