Fix incorrect local group state bug.

This commit is contained in:
Cody Henthorne
2024-06-26 11:30:33 -04:00
committed by Nicholas Tinsley
parent 37815a3f39
commit a66857a7cc
4 changed files with 26 additions and 9 deletions

View File

@@ -158,7 +158,7 @@ class GroupsV2StateProcessor private constructor(
when (serverUpdateResult) {
InternalUpdateResult.NoUpdateNeeded -> return GroupUpdateResult.CONSISTENT_OR_AHEAD
is InternalUpdateResult.Updated -> return GroupUpdateResult.updated(serverUpdateResult.updatedLocalState)
is InternalUpdateResult.UpdateFailed,
is InternalUpdateResult.UpdateFailed -> throw serverUpdateResult.throwable
is InternalUpdateResult.NotAMember -> Unit
}
@@ -184,11 +184,7 @@ class GroupsV2StateProcessor private constructor(
profileAndMessageHelper.leaveGroupLocally(serviceIds)
}
throw when (serverUpdateResult) {
is InternalUpdateResult.NotAMember -> GroupNotAMemberException(serverUpdateResult.exception)
is InternalUpdateResult.UpdateFailed -> throw serverUpdateResult.throwable
else -> AssertionError("Should not reach here with ${serverUpdateResult::class.java.simpleName}")
}
throw GroupNotAMemberException(serverUpdateResult.exception)
}
private fun canApplyP2pChange(