Repository navigation
fix(ios): send the first regions event without experimental_flushSync - #46
Open
maksim-atria wants to merge 1 commit into
Open
maksim-atria wants to merge 1 commit into
maksim-atria wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #45.
On iOS the first
regionsChangeevent was sent withexperimental_flushSync. That makes the main thread wait for the JS runtime. If JS calls a native function that usesdispatch_syncto the main queue at that moment, the two threads wait on each other and the app freezes. Every iPhone hits that flush once per provider mount, not only the Duo, because the first layout always counts as a change. #45 has the stacks.This sends the first event as a regular discrete event, like later changes but without the unique-event replacement.
useReservedRegionsReady()still becomes true with the first measurement, one beat later than before. The README and the platforms page already say readiness is not a first-frame guarantee. I updated both to say iOS no longer requests synchronous delivery. Android is unchanged.Verification
ReservedRegionsView.mmchanged.oxfmt --checkpasses on the changed docs.Known limitation
On the Duo, the first regions may now reach JS one beat after the first frame, so a layout that waits for readiness can show one frame later.