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(🐛): fix concurrency issue with surface events #2505

Merged
merged 1 commit into from
Jun 28, 2024
Merged

Conversation

wcandillon
Copy link
Contributor

@wcandillon wcandillon commented Jun 28, 2024

To handle react-native-screens, we always recreate the SurfaceTexture when a destroy event happens (because RN screens keep the parent view alive). We believe that there is currently a race condition where a surface event like onSurfaceSizeChange may happen when we have already manually destroyed the surface (via the onDropViewInstance event).

This PR:

  1. Cleans up the logic around the RN Screen handling.
  2. Fixes that potential race condition.

@kmagiera does this rational make sense here?

@hannojg @Nodonisko, I think I will release this patch regardless, as it provides better handling for RN Screens, even if it doesn't completely fix the race condition. I'm looking forward to reading your thoughts on this.

Copy link
Contributor

@hannojg hannojg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@wcandillon wcandillon merged commit fafff4c into main Jun 28, 2024
9 checks passed
Copy link
Contributor

🎉 This PR is included in version 1.3.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Nodonisko
Copy link
Contributor

I am not sure if this will solve all crashes since we sometimes got crash outside of screen change, but I will try to test this version ASAP. Great work thanks!

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

Successfully merging this pull request may close these issues.

3 participants