Skip to content

Conversation

crazytonyli
Copy link
Contributor

Description

The getCategoriesWithSuccess:failure: function was implemented incorrectly. We are supposed to return all categories, but the implementation only returns the first page. This PR fixes that issue.

@crazytonyli crazytonyli added this to the 26.3 milestone Sep 1, 2025
@crazytonyli crazytonyli requested a review from kean September 1, 2025 00:34
@crazytonyli crazytonyli changed the title Bugfix/load all categories Load all categories instead of just the first page Sep 1, 2025
The `raw` property becomes Optional in Automattic/wordpress-rs#863,
to handle revision related endpoints. However, it's still returned in the
/media?context=edit responses.
@crazytonyli crazytonyli force-pushed the bugfix/load-all-categories branch from 0e43b4b to eb10e28 Compare September 1, 2025 00:35
Copy link

sonarqubecloud bot commented Sep 1, 2025

@wpmobilebot
Copy link
Contributor

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 Number28703
VersionPR #24785
Bundle IDcom.jetpack.alpha
Commiteb10e28
Installation URL3l3p1q9kcv60g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

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 Number28703
VersionPR #24785
Bundle IDorg.wordpress.alpha
Commiteb10e28
Installation URL14dpaohu7iba0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Copy link
Contributor

@kean kean left a comment

Choose a reason for hiding this comment

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

LGTM.
I don't have a site with these many categories for testing, so I didnt.

@@ -144,7 +144,7 @@ private extension RemoteMedia {

self.mediaID = NSNumber(value: media.id)
self.url = URL(string: media.sourceUrl)
self.guid = URL(string: media.guid.raw)
self.guid = media.guid.raw.flatMap(URL.init(string:))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit URL.init should work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice. So I guess the compiler infers which initializer to use when seeing URL.init? I'll leave this code as it is for now, but I'll try this shorter syntax next time.

@crazytonyli crazytonyli added this pull request to the merge queue Sep 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 2, 2025
@crazytonyli crazytonyli added this pull request to the merge queue Sep 2, 2025
Merged via the queue into trunk with commit 5c0bf55 Sep 2, 2025
30 of 32 checks passed
@crazytonyli crazytonyli deleted the bugfix/load-all-categories branch September 2, 2025 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants