-
Notifications
You must be signed in to change notification settings - Fork 4.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
[Mobile] Fix crash when appending media (Android) #56791
Conversation
… files, it currently supports images and video only
… tests for subscribeMediaAppend
|
||
describe( 'Editor', () => { | ||
it( 'detects unsupported block and sends hasUnsupportedBlocks true to native', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this test because we have others that cover the Unsupported blocks functionality
Size Change: 0 B Total Size: 1.71 MB ℹ️ View Unchanged
|
Flaky tests detected in 6b90b4b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7168923434
|
|
||
this.props.insertBlock( newBlock, insertionIndex ); | ||
} else { | ||
createErrorNotice( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will serve as a fallback, a few changes were done in wordpress-mobile/WordPress-Android#19754 to prevent passing unsupported files when sharing files to the editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I was able to test the Android changes successfully. I wasn't able to test the generated iOS build due to App Center being down, but I did not note any issues when testing with a local build on iOS. 🚀
Thank you for the review and testing! 🚀 |
For reference, I observed that also in a production version, the editor takes several seconds to load (wordpress-mobile/gutenberg-mobile#6529). |
Related PRs:
Fixes wordpress-mobile/gutenberg-mobile#6443
What?
This PR fixes an issue when appending unsupported media types when using the Sharing functionality on Android devices.
The only way to be able to "Share" unsupported media types is when multi-selecting files that the app does support like images or videos.
Why?
To prevent the Android app from crashing.
How?
It adds a check using
getBlockType
to make sure the dynamic block name'core/' + payload.mediaType;
is registered correctly and that it exists.It also adds some tests for this functionality.
Testing Instructions
Android
PDF
,jpg
, andmp4
.iOS
Testing Instructions for Keyboard
N/A
Screenshots or screencast
TestCase1.mov
IOS.mp4