Fix request to rejoin after group updates bug.

This commit is contained in:
Cody Henthorne
2024-06-24 12:48:19 -04:00
committed by Greyson Parrelli
parent 57a70c3085
commit 21ada2a503
5 changed files with 10 additions and 5 deletions

View File

@@ -60,12 +60,16 @@ final class GroupJoinRepository {
callback.onComplete(new JoinGroupSuccess(groupActionResult.getGroupRecipient(), groupActionResult.getThreadId()));
} catch (IOException e) {
Log.w(TAG, "Network error", e);
callback.onError(JoinGroupError.NETWORK_ERROR);
} catch (GroupChangeBusyException e) {
Log.w(TAG, "Change error", e);
callback.onError(JoinGroupError.BUSY);
} catch (GroupLinkNotActiveException e) {
Log.w(TAG, "Inactive group error", e);
callback.onError(e.getReason() == GroupLinkNotActiveException.Reason.BANNED ? JoinGroupError.BANNED : JoinGroupError.GROUP_LINK_NOT_ACTIVE);
} catch (GroupChangeFailedException | MembershipNotSuitableForV2Exception e) {
Log.w(TAG, "Change failed", e);
callback.onError(JoinGroupError.FAILED);
}
});

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 -> throw serverUpdateResult.throwable
is InternalUpdateResult.UpdateFailed,
is InternalUpdateResult.NotAMember -> Unit
}
@@ -184,7 +184,11 @@ class GroupsV2StateProcessor private constructor(
profileAndMessageHelper.leaveGroupLocally(serviceIds)
}
throw GroupNotAMemberException(serverUpdateResult.exception)
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}")
}
}
private fun canApplyP2pChange(

View File

@@ -5,7 +5,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/signal_transparent_80"
android:gravity="center"
android:padding="17dp"
style="@style/Signal.Text.Preview"

View File

@@ -5,7 +5,6 @@
android:id="@+id/conversation_no_longer_member_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/signal_background_tertiary"
android:gravity="center"
android:paddingStart="16dp"
android:paddingTop="8dp"

View File

@@ -10,7 +10,6 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/signal_background_tertiary"
android:gravity="center"
android:paddingStart="16dp"
android:paddingTop="8dp"