-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Swallow exceptions on draw, forward to onError #46964
Conversation
This pull request was exported from Phabricator. Differential Revision: D64144596 |
9019e22
to
cc1985f
Compare
Summary: Graceful degradation is better than outright crashing. When rendering images that exceed Android's memory limits, React Native applications will fatally crash. This change intervenes by swallowing the exception that Android raises and forwards it to the `onError` handler. As a result, no image will be rendered instead of fatally crashing. Fresco already intervenes by default. It will raise a `PoolSizeViolationException` if the bitmap size exceeds memory limits set by the OS and applies a 2048 pixel maximum dimension to JPEG images, but it's still possible for these configuration limits to be removed and for images to fall just short of Fresco's memory limit. The exception is raised when we attempt to draw the bitmap, not when the bitmap is allocated in memory, so we must handle the exception here and not in Fresco. ## Changelog [Android][Fixed] - Apps will no longer fatally crash when trying to draw large images Reviewed By: tdn120 Differential Revision: D64144596
This pull request was exported from Phabricator. Differential Revision: D64144596 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D64144596 |
cc1985f
to
65a1b94
Compare
Summary: Pull Request resolved: facebook#46964 Graceful degradation is better than outright crashing. When rendering images that exceed Android's memory limits, React Native applications will fatally crash. This change intervenes by swallowing the exception that Android raises and forwards it to the `onError` handler. As a result, no image will be rendered instead of fatally crashing. Fresco already intervenes by default. It will raise a `PoolSizeViolationException` if the bitmap size exceeds memory limits set by the OS and applies a 2048 pixel maximum dimension to JPEG images, but it's still possible for these configuration limits to be removed and for images to fall just short of Fresco's memory limit. The exception is raised when we attempt to draw the bitmap, not when the bitmap is allocated in memory, so we must handle the exception here and not in Fresco. ## Changelog [Android][Fixed] - Apps will no longer fatally crash when trying to draw large images Reviewed By: tdn120 Differential Revision: D64144596
Summary: Pull Request resolved: facebook#46964 Graceful degradation is better than outright crashing. When rendering images that exceed Android's memory limits, React Native applications will fatally crash. This change intervenes by swallowing the exception that Android raises and forwards it to the `onError` handler. As a result, no image will be rendered instead of fatally crashing. Fresco already intervenes by default. It will raise a `PoolSizeViolationException` if the bitmap size exceeds memory limits set by the OS and applies a 2048 pixel maximum dimension to JPEG images, but it's still possible for these configuration limits to be removed and for images to fall just short of Fresco's memory limit. The exception is raised when we attempt to draw the bitmap, not when the bitmap is allocated in memory, so we must handle the exception here and not in Fresco. ## Changelog [Android][Fixed] - Apps will no longer fatally crash when trying to draw large images Reviewed By: tdn120 Differential Revision: D64144596
This pull request was exported from Phabricator. Differential Revision: D64144596 |
65a1b94
to
0e8d69e
Compare
This pull request has been merged in 483b928. |
This pull request was successfully merged by @Abbondanzo in 483b928 When will my fix make it into a release? | How to file a pick request? |
Summary:
Graceful degradation is better than outright crashing. When rendering images that exceed Android's memory limits, React Native applications will fatally crash. This change intervenes by swallowing the exception that Android raises and forwards it to the
onError
handler. As a result, no image will be rendered instead of fatally crashing.Fresco already intervenes by default. It will raise a
PoolSizeViolationException
if the bitmap size exceeds memory limits set by the OS and applies a 2048 pixel maximum dimension to JPEG images, but it's still possible for these configuration limits to be removed and for images to fall just short of Fresco's memory limit. The exception is raised when we attempt to draw the bitmap, not when the bitmap is allocated in memory, so we must handle the exception here and not in Fresco.Changelog
[Android][Fixed] - Apps will no longer fatally crash when trying to draw large images
Differential Revision: D64144596