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

Race condition between filtering and refreshing apps #417

Open
akariv opened this issue Oct 31, 2023 · 0 comments
Open

Race condition between filtering and refreshing apps #417

akariv opened this issue Oct 31, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@akariv
Copy link

akariv commented Oct 31, 2023

Long time user, I've noticed that sometimes, when quickly returning to the launcher, opening the drawer and starting to filter the apps, the app list resets to the full, unfiltered list ignoring the filter completely.

Steps to reproduce:

  • (After using another app for a long time)
  • Return to the launcher
  • Immediately open the app drawer
  • Start typing to filter the list
  • After typing 3 letters, the list is filtered
  • Then the list is re-populated with the original, full, app list.

After reading the code, my guess as to why this happens is that when using another app for a long time, the launcher needs to be re-created in Android, which, in turn, triggers a re-fetch of the system's App List.
However, if the user already started filtering before the results of this fetch arrive, they will override the apps in the adapter and disregard the current filter.

Solution proposal - probably around this area:

it?.let { adapter.setAppList(it.toMutableList()) }

After setting the apps list in the adapter, re-apply the filter so that the new filtered list remains in sync with the query string.

@tanujnotes tanujnotes added the good first issue Good for newcomers label Nov 2, 2023
tanujnotes added a commit that referenced this issue Apr 29, 2024
Race condition between filtering and refreshing apps #417
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants