Call reattachUploadingMedia() only for Aztec #9269
Merged
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.
EDIT: updated description and title to reflect solution as added in 3e6608a
Fixes #9268 by making sure to only make host app -> editor calls to media upload progress reattachment code for Aztec, as Gutenberg relies on the RN side of things to request the host app to start sending updates the other way around (editor -> host app). This is done by means of the
OnReattachQueryListenercall oncecomponenDidMountcallback gets called on the JS side.The crash started happening in current
developafter the introduction of 0e2237f in #9030, after media upload progress reattachment code was merged.There was a call in the SectionsPagerAdapter's
instantiateItemwhen the Fragment was still not attached, but this was unneeded as Gutenberg works differently in this regard: instead of taking the list of currently progressing uploads and then telling the Editor to paint the progress when we know we're about to show it (i.e.onResume()or on the pager adapterinstantiateItemcall) as we do for Aztec, we need to wait to know the RN side of things is ready to receive progress updates, which happens aftercomponentDidMountgets called, which in turn makes the query to the host app through the bridge'sOnReattachQueryListener.To test (copied from #9129):
Try the same on Aztec posts as well.
Update release notes:
RELEASE-NOTES.txt.