Support site settings writes through Core REST - #25865
Open
crazytonyli wants to merge 6 commits into
Open
Conversation
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33591 | |
| Version | PR #25865 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 4a4b15b | |
| Installation URL | 31mgp3ipvcd50 |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33591 | |
| Version | PR #25865 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 4a4b15b | |
| Installation URL | 32i4gvjar6h9g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Note
I recommend reviewing this PR commit by commit.
Description
Application-password sites use
BlogServiceRemoteCoreREST, butBlogService.updateSettingsForBlogonly dispatches WP.com REST and XML-RPC. Saving a setting therefore sends no request and invokes neither callback, leaving loading indicatorsactive.
One big refactor in this PR is that callers now pass a
BlogSettingsChangescontaining only the values changed by the user. Previously,BlogServicebuilt a full settings snapshot from Core Data for every save, which could overwriteunrelated settings. Writes are also serialized because UI controls can trigger multiple saves quickly.
The other main changes are:
BlogService.updateSettingswrites supported fields through/wp/v2/settingsand completes with exactly one callback for WP.com REST, Core REST, XML-RPC, and unavailable transports.WordPressClient.updateSiteSettingsreplaces the cached settings after a save. The site-icon flow also updates the header without waiting forsyncBlog, which has no Core REST path.Testing instructions
On a self-hosted application-password site: