Use REST editor for XML-RPC-disabled FAB actions - #25830
Conversation
Generated by 🚫 Danger |
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33420 | |
| Version | PR #25830 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | c1dc500 | |
| Installation URL | 1emc7pinc39q0 |
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33420 | |
| Version | PR #25830 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | c1dc500 | |
| Installation URL | 2lvqcojl2f7fo |
2a3c86d to
b943f65
Compare
|
In the presenting and dismissing editor animation, a site title label slides in and out of the screen, which is unexpected. It's caused by the navigation bar customization code in ScreenRecording_07-23-2026.12-54-39_1.MP4 |
| let blog: Blog | ||
| let postType: PinnedPostType | ||
| let initialContent: EditorContent? | ||
| let presentingViewController: UIViewController |
There was a problem hiding this comment.
Claude thinks you have a retain cycle here:
| let presentingViewController: UIViewController | |
| unowned let presentingViewController: UIViewController |
Details
**Retain cycle — the editor leaks on every create.**presentCoreRESTEditor(...) assigns this view as the rootView of the very UIHostingController it then passes back in here as presentingViewController:
controller.rootView = AnyView(
CoreRESTPostEditorRoute(..., presentingViewController: controller)
)That makes controller → rootView → CoreRESTPostEditorRoute → presentingViewController → controller a strong reference cycle, so the hosting controller and the whole editor hierarchy (editor VC, web view, view models, WpService) never deallocate after dismissal — one leak per post/page created.
Unlike the sibling views (PinnedPostTypeView, CustomPostTabView, ApplicationPasswordRequiredView), where the presenter is an external VC and weak var …? is right, here the presenter is the controller that owns this view. unowned breaks the cycle and states that invariant — the owner is always alive while this view exists — while keeping the type non-optional so nothing downstream changes:
jkmassel
left a comment
There was a problem hiding this comment.
I tested this on-device with https://xmlrpc-disabled-by-plugin.wpmt.co/ and it worked for me!
Left one suggestion
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
* Apply Swift formatting * Generalize the post type resolver view * Use REST editor for XML-RPC-disabled FAB actions * Make presentingViewController a weak reference
* Improve self-hosted sign-in error logging (wordpress-mobile#25814) * Prevent site title button clipping (wordpress-mobile#25831) * Use REST editor for XML-RPC-disabled FAB actions (wordpress-mobile#25830) * Apply Swift formatting * Generalize the post type resolver view * Use REST editor for XML-RPC-disabled FAB actions * Make presentingViewController a weak reference * Merge release_notes/27.1 into release/27.1 (wordpress-mobile#25835) * Add editorialized release notes for version * Update metadata strings * Update metadata strings --------- Co-authored-by: Tony Li <tony.li@automattic.com> * Update app translations – `Localizable.strings` * Update app translations – Other `.strings` * Update plural translations from GlotPress * Update WordPress metadata translations * Update Jetpack metadata translations * Bump version number --------- Co-authored-by: Tony Li <tony.li@automattic.com>


Description
This fixes a production app bug.
When XML-RPC is disabled, the quick actions to create post and pages present the
AbstractPostpost editor, which does not work when XML-RPC is disabled. This PR switches to use the "Custom Post Types" post editor which uses core REST API.I intentionally kept the scope small, due to we are in the code freeze. The same issue would happen on other creating post entry points: universal link, shortcuts, etc. I will create a separate PR to fix them on the trunk branch.