[RNMobile] Fix crash in mobile paragraph blocks with custom font size#28121
Conversation
|
Size Change: 0 B Total Size: 1.28 MB ℹ️ View Unchanged
|
|
I know that the fix here is not addressing anything on the named sizes case (Normal/Medium/Large/etc) but just want to point out that when the named sizes are found, the mobile block editor seems to just revert to the default font size. Besides that, the fix works nicely with the sizes set via numbers (which end up pass via the I'd say let's address the named sizes issue in a different PR/fix. Would you mind opening a ticket about it Cameron? Thanks! |
|
|
||
| // Fix for crash https://github.com/wordpress-mobile/gutenberg-mobile/issues/2991 | ||
| convertFontSizeFromString( fontSize ) { | ||
| return fontSize && fontSize.endsWith( 'px' ) |
There was a problem hiding this comment.
Not sure, I wonder if there could be more cases of value+unit other than px. Like, pt or em.
Should be fine to fix only for px now, but feels like we should take the opportunity to improve detecting such issue. The error message we encounter is [java.lang.String cannot be cast to java.lang.Double](java.lang.String cannot be cast to java.lang.Double) on Android, and it will be that again if a different unit is encountered, making it difficult for us to know if we really fixed the crash or not. Any ideas how to signal that something else than px was found?
I think that we don't have a good way to add breadcrumbs to the Sentry logs, but maybe you have some idea Cameron?
|
I think there's enough confidence in this fix that it will not inadvertently affect other parts of the app so, what do you think about changing the PRs to make them into betafix ones @cameronvoell ? |
hypest
left a comment
There was a problem hiding this comment.
LGTM'ing this PR so we can move forward incorporating the fix. All my comments are non-blocking and be worked on on follow up work.
I'll set up PRs for a betafix for this fix, targeting 1.44.0 release. |
…#28121) * Remove px suffix from fontSize for Android paragraph * Issue does not seem to be limited to android on latest gutenberg master * Move fontSize char removal to richtext to account for multiple block errors
* Release script: Update react-native-editor version to 1.44.0 * Release script: Update with changes from 'npm run core preios' * Mobile - Link settings - Fix data not being saved when closing the bottom sheet (#27997) * Set onComplete handler as optional in Range cell component (#27987) Range cell component is used in multiple components but not all of them require the onComplete handler so it should be optional. * Mobile - Link settings - Check for onClose (#28039) * Fix: Add Image style settings for hotlinked images (#28006) * Update CHANGELOG.md (#28042) * Change spaces back to tabs * Release script: Update react-native-editor version to 1.44.1 * Release script: Update with changes from 'npm run core preios' * [RNMobile] Fix crash in mobile paragraph blocks with custom font size (#28121) * Remove px suffix from fontSize for Android paragraph * Issue does not seem to be limited to android on latest gutenberg master * Move fontSize char removal to richtext to account for multiple block errors * Add move to top bottom when long pressing block movers (#27554) * WC: Added move to top and bottom functionality via long pressing BlockMover buttons and clicking the button on the BottomSheet Picker. * WIP: Unit tests. * WC: WIP unit tests for add move to top and bottom * WC: Moving UI tests to gutenberg with other UI tests instead of keeping at gutenberg-mobile. Adding more convenience functions to EditorPage. * WIP: Unit tests. * WC: Adding icon and title to picker for move to top/bottom. * WC: Cleaning up code. * WC: Fixing merge issue where import was changed to const. * WC: Changing all imports to requires as per jest bug. * WC: Removing before/afterAll blocks from UI tests. * WC: Removing e2e tests to issue-1191-add-move-to-top-bottom-ui-tests branch. * WC: Updating imports to fall in line with other files. Co-authored-by: Wendy Chen <wendy.chen@automattic.com> * Fixed crash introduced from recent fontSize fix (#28209) * Updated changelog Co-authored-by: Paul Von Schrottky <paul.von.schrottky@automattic.com> Co-authored-by: Gerardo Pacheco <gerardo.pacheco@automattic.com> Co-authored-by: Carlos Garcia <fluiddot@gmail.com> Co-authored-by: Enej Bajgoric <enej.bajgoric@automattic.com> Co-authored-by: illusaen <tilphousia@gmail.com> Co-authored-by: Wendy Chen <wendy.chen@automattic.com>
Fixes wordpress-mobile/gutenberg-mobile#2991
Description
Fixes a crash occurring in WordPress-Android/WordPress-iOS when you load an article that has paragraph block swith custom fontSizes that have been set from the web.
See gb-mobile PR: wordpress-mobile/gutenberg-mobile#2993
How has this been tested?
See gutenberg-mobile PR: wordpress-mobile/gutenberg-mobile#2993
Screenshots
See gutenberg-mobile PR: wordpress-mobile/gutenberg-mobile#2993
Types of changes
Changes affect mobile Android and iOS apps only
Checklist: