Fix blocking bugs for internal link and sync testing.

This commit is contained in:
Cody Henthorne
2025-10-08 16:09:01 -04:00
parent 33a7f55fa3
commit f8eaa96412
27 changed files with 212 additions and 124 deletions

View File

@@ -1272,7 +1272,7 @@ final class GroupManagerV2 {
GroupId.V2 groupId = GroupId.v2(masterKey);
Recipient groupRecipient = Recipient.externalGroupExact(groupId);
GV2UpdateDescription updateDescription = GroupProtoUtil.createOutgoingGroupV2UpdateDescription(masterKey, groupMutation, signedGroupChange);
OutgoingMessage outgoingMessage = OutgoingMessage.groupUpdateMessage(groupRecipient, updateDescription, System.currentTimeMillis());
OutgoingMessage outgoingMessage = OutgoingMessage.groupUpdateMessage(groupRecipient, updateDescription, System.currentTimeMillis(), false);
DecryptedGroupChange plainGroupChange = groupMutation.getGroupChange();

View File

@@ -672,7 +672,7 @@ class GroupsV2StateProcessor private constructor(
)
val updateDescription = GroupProtoUtil.createOutgoingGroupV2UpdateDescription(masterKey, GroupMutation(decryptedGroup, simulatedGroupChange, simulatedGroupState), null)
val leaveMessage = OutgoingMessage.groupUpdateMessage(groupRecipient, updateDescription, System.currentTimeMillis())
val leaveMessage = OutgoingMessage.groupUpdateMessage(groupRecipient, updateDescription, System.currentTimeMillis(), isSelfGroupAdd = false)
try {
val threadId = SignalDatabase.threads.getOrCreateThreadIdFor(groupRecipient)
@@ -728,10 +728,17 @@ class GroupsV2StateProcessor private constructor(
)
if (outgoing) {
val isSelfGroupAdd = updateDescription
.groupChangeUpdate!!
.updates
.asSequence()
.mapNotNull { it.groupMemberJoinedUpdate }
.any { serviceIds.matches(it.newMemberAci) }
try {
val recipientId = SignalDatabase.recipients.getOrInsertFromGroupId(groupId)
val recipient = Recipient.resolved(recipientId)
val outgoingMessage = OutgoingMessage.groupUpdateMessage(recipient, updateDescription, timestamp)
val outgoingMessage = OutgoingMessage.groupUpdateMessage(recipient, updateDescription, timestamp, isSelfGroupAdd)
val threadId = SignalDatabase.threads.getOrCreateThreadIdFor(recipient)
val messageId = SignalDatabase.messages.insertMessageOutbox(outgoingMessage, threadId, false, null).messageId