Skip to content
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

Add Members screen inconsistencies/CRASH #13857

Open
3 tasks done
Sagar0-0 opened this issue Dec 28, 2024 · 2 comments
Open
3 tasks done

Add Members screen inconsistencies/CRASH #13857

Sagar0-0 opened this issue Dec 28, 2024 · 2 comments

Comments

@Sagar0-0
Copy link

Guidelines

  • I have searched searched open and closed issues for duplicates
  • I am submitting a bug report for existing functionality that does not work as intended
  • This isn't a feature request or a discussion topic

Bug description

Steps to reproduce:

  1. Go to any Group Details and navigate to Add a new Member screen.
  2. Try clicking on a contact multiple times, leading to adding and removing it from the selected members list.
  3. This can cause some inconsistencies, like the total members count in the topbar, or the "Done" button being enabled or disabled.
  4. If no new member is selected and the Done button is Enabled, then this can lead to the app crashing or unexpected behavior.

These inconsistencies can also be seen when creating a new group. The topbar and the "Next" button can behave weirdly or not expected.

Possible Solutions:

  1. We might have to change the behavior of how we are updating the UI state. We are using SimpleTask.run to update the UI states, which is causing the issue, I am investigating this and will update the comments when I have solved this.
  2. Simply Add an additional check when clicking on the done button, although the Precondition is already there but this does not help the user or UI, it just closes the screen as shown in the video.

Screenshots

document_6300953998052561959.mp4

Device

Realme GT NEO 3T

Android version

14

Signal version

7.28.4

Link to debug log

https://debuglogs.org/android/7.28.4/5ad56851355873fcf53a0171424f0dde3f31689ebfd4bc20c762b5f9a761895d

@Sagar0-0 Sagar0-0 changed the title Add Members screen selection inconsistencies Add Members screen inconsistencies/CRASH Dec 28, 2024
@Sagar0-0
Copy link
Author

There are 3 issues with this screen AddMembersActivity.

  1. The topbar has inconsistent Contacts count from getTotalMemberCount function.
  2. The Done button is enabled even when no new member is selected.
  3. The contactsFragment.getSelectedContacts() doesn't always send the latest value to the done button, which causes the Exception.

Improvements in the ContactSearchMediator#SelectedContacts should solve the issue.

@Sagar0-0
Copy link
Author

Sagar0-0 commented Dec 28, 2024

My recommended approach is to use the contactMediator.getSelectionState() to get the livedata and observe it directly on the ContactSelectionListFragement. (The activities needing the selected contacts list are not the right place to observe onto this LiveData as they depend solely on the Fragment for any Contacts list updates).
Although the problem still exists If we replace the observed State with the contactSearchMediator.getSelectedContacts() at all places in ContactSelectionListFragement. So, I believe these two selectionStore.state and selectionStore.stateLiveData#latestValue always gives same result at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant