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: int cast can cause endless loop if value < 1 #38016

Closed
wants to merge 3 commits into from

Conversation

g4rb4g3
Copy link
Contributor

@g4rb4g3 g4rb4g3 commented Jun 22, 2023

Summary:

I faced an issue that on Android the whole UI would freeze when using minimumFontScale. This is caused by an int cast that turns the while loop into an endless loop.
Also the docs are not correct since they say it is an iOS only prop.
https://reactnative.dev/docs/text#minimumfontscale-ios

Changelog:

[ANDROID] [FIXED] - UI freezing when using minimumFontScale

Test Plan:

Run this sample app with and without this fix. https://github.com/g4rb4g3/androidMinimumFontScaleBug
Without the ui will freeze when hitting the + button, with the fix a Text component will be shown and no freeze will happen. 🙂

@facebook-github-bot
Copy link
Contributor

Hi @g4rb4g3!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

g4rb4g3 and others added 2 commits June 22, 2023 11:02
…react/views/text/ReactTextShadowNode.java

Co-authored-by: Nick Gerleman <nick@nickgerleman.com>
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 22, 2023
@facebook-github-bot
Copy link
Contributor

@NickGerleman has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,966,520 +22
android hermes armeabi-v7a 8,227,778 +20
android hermes x86 9,480,149 +30
android hermes x86_64 9,322,894 +18
android jsc arm64-v8a 9,527,565 -20
android jsc armeabi-v7a 8,666,146 -29
android jsc x86 9,612,060 -28
android jsc x86_64 9,858,911 -33

Base commit: 0e41ad0
Branch: main

@github-actions
Copy link

This pull request was successfully merged by @g4rb4g3 in 79e8474.

When will my fix make it into a release? | Upcoming Releases

@github-actions github-actions bot added the Merged This PR has been merged. label Jun 23, 2023
@g4rb4g3
Copy link
Contributor Author

g4rb4g3 commented Jun 23, 2023

Great that it is merged already 🎉 Any idea when it will be released?
Since we use Expo SDK 48 right now, will there be a 0.71.x release including this fix?

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. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants