Skip to content

Fix an issue with RemoteBlog failing to parse non-standard capabilities#25474

Open
kean wants to merge 3 commits intotrunkfrom
fix/parsing-non-standard-capabilities
Open

Fix an issue with RemoteBlog failing to parse non-standard capabilities#25474
kean wants to merge 3 commits intotrunkfrom
fix/parsing-non-standard-capabilities

Conversation

@kean
Copy link
Copy Markdown
Contributor

@kean kean commented Apr 1, 2026

Description

This is an addition to CMM-2013: Login with application passwords fails if the user has non-boolean capabilities field that implements a change similar to Automattic/wordpress-rs#1263 in WordPressKit that is still used by the app (more details in the linked PR). It also extends the tests with some actual assertions.

Testing

I added a unit test and also mocked a capability in question in capabilities JSON to make sure it gets parsed for sites that do have capabilities (Jetpack).

  • Verify that you can upload media on a Dotcom sites (requires clean install to ensure it works not because of the previous saved data).

@kean kean added this to the 26.9 milestone Apr 1, 2026
@kean kean added the General label Apr 1, 2026

/// Blog's capabilities: Indicate which actions are allowed / not allowed, for the current user.
public var capabilities: [String: Bool]
public var capabilities: [String: Any]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A relatively safe change because Blog.capabilties are already modeled as [AnyHashable: Any] and are fully in Swift, so no changes needed in the app.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 1, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number32004
VersionPR #25474
Bundle IDorg.wordpress.alpha
Commit1b4c732
Installation URL21po4io68kf78
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 1, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number32004
VersionPR #25474
Bundle IDcom.jetpack.alpha
Commit1b4c732
Installation URL0jah0osornnqo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@kean kean requested a review from jkmassel April 2, 2026 15:20
Copy link
Copy Markdown
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failing tests probably need some attention, apart from that (and the diff noise in the JSON fixture) I think this is good to go

@@ -1,518 +1,519 @@
{
"sites": [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this reformatting be removed so that it properly reflects the single-line addition?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@kean
Copy link
Copy Markdown
Contributor Author

kean commented Apr 10, 2026

I updated the existing tests.

@kean kean requested a review from jkmassel April 10, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants