Fix group updates from others showing before messages made before the update.

This commit is contained in:
Cody Henthorne
2026-02-11 13:49:29 -05:00
committed by Michelle Tang
parent 611b52780e
commit dd396eb75a
3 changed files with 7 additions and 3 deletions

View File

@@ -648,7 +648,11 @@ class GroupsV2StateProcessor private constructor(
}
else -> {
storeMessage(GroupProtoUtil.createDecryptedGroupV2Context(masterKey, GroupMutation(runningGroupState, entry.change, entry.group), null), runningTimestamp, serverGuid)
storeMessage(
decryptedGroupV2Context = GroupProtoUtil.createDecryptedGroupV2Context(masterKey, GroupMutation(runningGroupState, entry.change, entry.group), null),
timestamp = runningTimestamp,
serverGuid = serverGuid
)
runningTimestamp++
}
}

View File

@@ -279,7 +279,7 @@ open class MessageContentProcessor(private val context: Context) {
): GroupUpdateResult? {
return try {
val signedGroupChange: ByteArray? = if (groupV2.hasSignedGroupChange) groupV2.signedGroupChange else null
val updatedTimestamp = if (signedGroupChange != null) timestamp else timestamp - 1
val updatedTimestamp = if (signedGroupChange != null) timestamp else timestamp + 1
if (groupV2.revision != null) {
GroupManager.updateGroupFromServer(context, groupV2.groupMasterKey, localRecord, groupSecretParams, groupV2.revision!!, updatedTimestamp, signedGroupChange, serverGuid)
} else {

View File

@@ -106,7 +106,7 @@ class IncomingMessage(
return IncomingMessage(
from = from,
sentTimeMillis = timestamp,
receivedTimeMillis = timestamp,
receivedTimeMillis = System.currentTimeMillis(),
serverTimeMillis = timestamp,
serverGuid = serverGuid,
groupId = groupId,