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

fix ConcurrentModificationException when other text watchers are installed #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dhvector
Copy link

I experienced this in a react-native app when using another library, LogRocket, which globally scans for text views to install their own text watcher for analytics purposes.

And along with react-native, I have these installed as well:

What triggers the crash is:

  1. when the React Native text component loops over an iterator
  2. this library's afterTextChanged is called which modifies the list while it's being iterated
  3. there are any other text watchers (e.g. LogRocket) that come after this one in the list.
  4. the iterator will try to fetch its next element, which fails with ConcurrentModificationException during the check for comodification.

If not for (3), the crash is avoided.

With this PR, I was able to substitute this library out for a patched one and confirmed it fixes the issue.

Let me know if you need anything else.

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.

1 participant