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

doFetchModBlockedList: don't block ui thread #7674

Merged
merged 2 commits into from
Aug 12, 2022
Merged

Conversation

jessopb
Copy link
Member

@jessopb jessopb commented Aug 12, 2022

doFetchModBlockedList is blocking the ui thread.

Duplicate data in doFetchModBlockedList::blockListsPerChannel to about 1000. The tab is dead when function hits, about 4s after reload.

  • Yield occasionally using the setTimeout method.

  • Doing a chunk size of 1 for now so we don't have to yield the inner loop as well (seems good enough). This is just based on a relatively large blocklist size.

  • Can't do await in a callback, so must change the forEach to a for.

doFetchModBlockedList is blocking the ui thread.

Duplicate data in `doFetchModBlockedList::blockListsPerChannel` to about 1000. The tab is dead when function hits, about 4s after reload.

- Yield occasionally using the `setTimeout` method.
- Doing a chunk size of 1 for now so we don't have to yield the inner loop as well (seems good enough). This is just based on a relatively large blocklist size.

- Can't do `await` in a callback, so must change the `forEach` to a `for`.
@jessopb jessopb merged commit 1c17ff5 into master Aug 12, 2022
@jessopb jessopb deleted the background-modBlockedList branch August 12, 2022 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants