-
Notifications
You must be signed in to change notification settings - Fork 758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Space list crash fix #5924
Space list crash fix #5924
Conversation
Maybe the correct fix is to filter space invites here: https://github.com/vector-im/element-android/blob/cf532550d079b02a6ec9e49d83886836bc99f0a1/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt#L144 They are maybe displayed twice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -117,7 +123,7 @@ class SpaceSummaryController @Inject constructor( | |||
?.forEach { roomSummary -> | |||
spaceSummaryItem { | |||
avatarRenderer(host.avatarRenderer) | |||
id(roomSummary.roomId) | |||
id("invite_${roomSummary.roomId}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a unique id for the invite makes sense to me to fix the crash, we can iterate on the proper UX (whether two spaces with the same id should be present in the spaces list...)
cf53255
to
70c1310
Compare
@@ -135,41 +141,42 @@ class SpaceSummaryController @Inject constructor( | |||
} | |||
|
|||
rootSpaces | |||
?.forEach { groupSummary -> | |||
val isSelected = selected is RoomGroupingMethod.BySpace && groupSummary.roomId == selected.space()?.roomId | |||
?.filter { it.membership != Membership.INVITE } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Type of change
Content
Try to fix https://github.com/matrix-org/element-android-rageshakes/issues/37765 :
According to the log, this is a space invite. We may have a race condition, where an invite is displayed for a space which is already joined? So displayed twice and the Epoxy item has the same ID. This PR adds a prefix for the space invitation items.
Also space invite will be filtered out from the space root list. This is probably the only required fix, but keeping the previous fix on the
id
does not hurt.Motivation and context
Screenshots / GIFs
Tests
Tested devices
Checklist