Fix GV1->GV2 migration bug where users were incorrectly marked as dropped.

This commit is contained in:
Greyson Parrelli 2020-12-04 20:30:06 -05:00
parent 4321fabf0b
commit 3f75e4aeb3

View file

@ -507,10 +507,11 @@ public final class GroupDatabase extends Database {
List<RecipientId> newMembers = Stream.of(DecryptedGroupUtil.membersToUuidList(decryptedGroup.getMembersList())).map(u -> RecipientId.from(u, null)).toList(); List<RecipientId> newMembers = Stream.of(DecryptedGroupUtil.membersToUuidList(decryptedGroup.getMembersList())).map(u -> RecipientId.from(u, null)).toList();
List<RecipientId> pendingMembers = Stream.of(DecryptedGroupUtil.pendingToUuidList(decryptedGroup.getPendingMembersList())).map(u -> RecipientId.from(u, null)).toList(); List<RecipientId> pendingMembers = Stream.of(DecryptedGroupUtil.pendingToUuidList(decryptedGroup.getPendingMembersList())).map(u -> RecipientId.from(u, null)).toList();
List<RecipientId> droppedMembers = new ArrayList<>(SetUtil.difference(record.getMembers(), newMembers));
newMembers.addAll(pendingMembers); newMembers.addAll(pendingMembers);
List<RecipientId> droppedMembers = new ArrayList<>(SetUtil.difference(record.getMembers(), newMembers));
if (droppedMembers.size() > 0) { if (droppedMembers.size() > 0) {
contentValues.put(FORMER_V1_MEMBERS, RecipientId.toSerializedList(record.getMembers())); contentValues.put(FORMER_V1_MEMBERS, RecipientId.toSerializedList(record.getMembers()));
} }