build: bump wordpress-rs to 0.6.0 in the demo apps - #572
Draft
dcalhoun wants to merge 3 commits into
Draft
Conversation
The demo app was pinned to the `alpha-20260313` revision, which predates the plain-permalink fix in wordpress-rs (2924e36b, "Fix self-hosted login on plain-permalink sites"). On a site using plain permalinks, endpoint URLs were built by extending the root's path, so loading post types failed to parse a non-JSON response before the editor could open. Migrate to the `SiteInfo` API, which replaces the `apiRootUrl` and `apiUrlResolver` arguments on `WordPressAPI`, matching the equivalent change in WordPress-iOS#25516. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/572")Built from 0dd6547 |
The demo app was pinned to a March trunk build predating the plain-permalink fix in wordpress-rs (2924e36b). Unlike iOS, the failure was silent: `loadPostTypes` returns null on error and the caller falls back to a hardcoded `post` type, so a plain-permalink site opened the editor configuration with only "Posts" in the picker rather than the site's real post types. 0.6.0 requires compileSdk 36 (via okhttp 5.4.0) and minSdk 26, so raise both in the demo app. Only `:app` depends on wordpress-rs, so the published `:Gutenberg` library keeps compileSdk 34 and minSdk 24 and its consumers are unaffected. WordPress-Android already builds against 36 with minSdk 26, so the demo app is not moving ahead of its host. 0.6.0 also removed `wordpressComSiteApiRoot()`. Replace it with a local constant using the same URL format, which the demo app relies on to recover the site ID from a stored account. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dcalhoun
force-pushed
the
build/bump-wordpress-rs-0.6.0
branch
from
July 31, 2026 20:36
df33ffc to
b1da025
Compare
The local WordPress branch caught `URLError` to explain that wp-env may not be running, but that clause could never match. wordpress-rs intercepts the underlying `URLError` in `SafeRequestExecutor` and rewraps it as `WpApiError.RequestExecutionFailed(reason: .nonExistentSiteError)`, so a stopped wp-env surfaced the raw "A server with the specified hostname could not be found." instead of the guidance. Match the rewrapped error as well, mirroring the existing `isNetworkError` helper. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
What?
Bumps
wordpress-rsfrom pre-release pins to the0.6.0release on both platforms, and adapts to the API changes that release introduced.Why?
Neither demo app can load a self-hosted site's data when the site uses plain permalinks. Such a site has no path-based REST root — WordPress advertises the query form
https://site/?rest_route=/instead. Both apps were pinned to March builds that constructed endpoint URLs by extending the root's path, leaving therest_routequery dangling, so requests returned a non-JSON page.The symptom differed by platform, which is why this went unnoticed on Android:
loadPostTypesreturnsnullon failure and the caller substitutes a hardcodedpost, so the screen opened but the post-type picker listed only "Posts" instead of the site's real types.wordpress-rsfixed this in2924e36b(July 6), included in0.6.0:WpOrgSiteApiUrlResolver::resolvenow appends into therest_routevalue rather than the path. Both pins predated it by ~4 months.How?
iOS — package requirement moves from
kind = revision/alpha-20260313to0.6.0. Replaces the removedapiRootUrlandapiUrlResolverarguments onWordPressAPIwith the newSiteInfoenum, matching WordPress-iOS#25516.Android — version catalog moves from
trunk-dc86c7a6to0.6.0. This required two build changes in the demo app only:compileSdk/targetSdk34 → 36, because 0.6.0 pulls okhttp 5.4.0, which requires API 36.minSdk24 → 26, required by the 0.6.0 AAR manifest.Only
:appdepends on wordpress-rs, so the published:Gutenberglibrary keepscompileSdk34 andminSdk24 — this is not a breaking change for library consumers. WordPress-Android already builds against 36 withminSdk26 and consumes wordpress-rs0.6.0, so the demo app is not moving ahead of its host.0.6.0 also removed
wordpressComSiteApiRoot()from thewp_mobileaccount layer. It's replaced with a local helper using the identical URL format (…/wp/v2/sites/{id}), which matters because the demo app parses the site ID back out of the stored account in two places. WordPress-Android has no equivalent to update — it uses only the client and login APIs, not wordpress-rs account persistence.Demo apps and their build configuration only — no changes to the published GutenbergKit library or its SDK levels.
Testing Instructions
You need a self-hosted site set to Settings ▸ Permalinks ▸ Plain. Confirm it advertises the query-form REST root before starting:
The
rel="https://api.w.org/"value should contain?rest_route=/rather than/wp-json/.iOS
ios/Demo-iOS/Gutenberg.xcodeproj.libwordpressFFI.xcframework, run File ▸ Packages ▸ Resolve Package Versions — the pin change invalidates the cached binary artifact.Before: fails with "Response couldn't be parsed: expected value at line 1 column 1". After: the screen loads and the API Root row shows the
?rest_route=form.Android
Before: only "Posts". After: the site's real post types, including "Pages".
Both — confirm no regression for a pretty-permalink site and a WP.com site; each should behave as before. On Android, WP.com sign-in is worth exercising specifically, since it covers the
wordPressComSiteApiRootreplacement.Note that reaching a fully working editor on a plain-permalink site also needs the library fix in
fix/support-plain-permalinks, which is stacked on this branch — this PR gets site preparation past the failures above.Accessibility Testing Instructions
N/A — no user interface changes.