Skip to content

fix ConcurrentModificationException in ReactScrollViewHelper#45550

Closed
alanleedev wants to merge 1 commit into
facebook:mainfrom
alanleedev:export-D59991739
Closed

fix ConcurrentModificationException in ReactScrollViewHelper#45550
alanleedev wants to merge 1 commit into
facebook:mainfrom
alanleedev:export-D59991739

Conversation

@alanleedev
Copy link
Copy Markdown
Contributor

@alanleedev alanleedev commented Jul 19, 2024

Summary:
ConcurrentModificationException is happening from emitScrollEvent().
This usually happens if we modify the collection (add/remove) while accessing collection in a foreach loop.
Seems likely add/remove is called from a different thread while in the foreach loop.
Converting to list before we do the foreach as a quick fix.

Changelog: [Internal] - quick fix for exception

Reviewed By: mdvacca

Differential Revision: D59991739

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Jul 19, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D59991739

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D59991739

…k#45550)

Summary:
Pull Request resolved: facebook#45550

`ConcurrentModificationException` is happening from `emitScrollEvent()`.
This usually happens if we modify the collection (add/remove) while accessing collection in a foreach loop.
Seems likely add/remove is called from a different thread while in the foreach loop.
Converting to list before we do the foreach as a quick fix.

Changelog: [Internal] - quick fix for exception

Issure reported here: https://fb.workplace.com/groups/rn.support/permalink/26557068097248454/

Reviewed By: mdvacca

Differential Revision: D59991739
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D59991739

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 20, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 3a5eb19.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @alanleedev in 3a5eb19

When will my fix make it into a release? | How to file a pick request?

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants