Do not create PeerSession for groups we created

This needs a CreatorSession which gets created on-demand.
This commit is contained in:
Torsten Grote
2021-01-14 14:02:00 -03:00
parent 2ddb7b5b64
commit c4c70f5ac2
6 changed files with 51 additions and 7 deletions

View File

@@ -709,6 +709,30 @@ public class GroupInvitationIntegrationTest
assertTrue(deleteMessages0From1(emptySet()).allDeleted());
}
@Test
public void testInvitationAfterReAddingContacts() throws Exception {
// sync invitation and response back
sendInvitation(c0.getClock().currentTimeMillis(), null);
sync0To1(1, true);
groupInvitationManager1
.respondToInvitation(contactId0From1, privateGroup, true);
sync1To0(1, true);
// sync group join messages
sync0To1(2, true); // + one invitation protocol join message
sync1To0(1, true);
assertFalse(groupInvitationManager0
.isInvitationAllowed(contact1From0, privateGroup.getId()));
// re-add contacts
removeAllContacts();
addDefaultContacts();
assertTrue(groupInvitationManager0
.isInvitationAllowed(contact1From0, privateGroup.getId()));
}
private Collection<ConversationMessageHeader> getMessages1From0()
throws DbException {
return db0.transactionWithResult(true, txn -> groupInvitationManager0

View File

@@ -196,6 +196,9 @@ public class GroupInvitationManagerImplTest extends BrambleMockTestCase {
oneOf(privateGroupManager).isMember(txn, privateGroup.getId(),
c.getAuthor());
will(returnValue(true));
oneOf(privateGroupManager)
.isOurPrivateGroup(txn, privateGroup.getId());
will(returnValue(false));
}});
expectAddingMember(privateGroup.getId(), c);
}

View File

@@ -523,10 +523,10 @@ public abstract class BriarIntegrationTest<C extends BriarIntegrationTestCompone
contactManager0.removeContact(contactId2From0);
contactManager1.removeContact(contactId0From1);
contactManager2.removeContact(contactId0From2);
assertNotNull(contactId2From1);
contactManager1.removeContact(contactId2From1);
assertNotNull(contactId1From2);
contactManager2.removeContact(contactId1From2);
if (contactId2From1 != null)
contactManager1.removeContact(contactId2From1);
if (contactId1From2 != null)
contactManager2.removeContact(contactId1From2);
}
protected void setAutoDeleteTimer(BriarIntegrationTestComponent component,