CMM-2122: Fetch all category/tag pages in wp-rs taxonomy client#23012
CMM-2122: Fetch all category/tag pages in wp-rs taxonomy client#23012nbradbury wants to merge 8 commits into
Conversation
The application-password REST path requested terms with a bare TermListParams(), which uses the WordPress REST API default of per_page=10 and fetched only the first page. The store then cleared and repopulated the local taxonomy table with just those 10 terms, so the post editor's category picker showed at most 10 categories. Request 100 terms per page and follow nextPageParams until exhausted so all terms are fetched, mirroring the pattern already used by PostRsRestClient. On a page error, dispatch a single error action without persisting partial results. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Generated by 🚫 Danger |
The added pagination tests pushed the comprehensive test class past detekt's 600-line LargeClass threshold. Suppress it to match the convention used by other large test classes in the repo, rather than duplicating the shared mock setup across two classes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The fetchTerms function has a single return statement, below detekt's ReturnCount threshold, so the suppression was dead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…roid-app-shows-incomplete-categories-list
|
|
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #23012 +/- ##
=======================================
Coverage 37.42% 37.42%
=======================================
Files 2325 2325
Lines 125399 125407 +8
Branches 17205 17206 +1
=======================================
+ Hits 46929 46937 +8
Misses 74656 74656
Partials 3814 3814 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…roid-app-shows-incomplete-categories-list
…roid-app-shows-incomplete-categories-list
|
Should this bugfix go into the 26.9 release? |
adalpari
left a comment
There was a problem hiding this comment.
LGTM and works as expected! ![]()
…te-categories-list
@crazytonyli If it's not too late it would be good to get this into 26.9. Want me to create a PR for that? |
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>


Description
Fixes CMM-2122
After updating to v26.8, the post editor's category picker showed only 10 categories even when the site had many more.
Root cause: WP.com/Jetpack sites now fetch categories through the application-password REST path (
TaxonomyRsApiRestClient). That code built its request with a bareTermListParams(), which uses the WordPress REST API default ofper_page=10and fetched only the first page.Fix: Request 100 terms per page and follow
nextPageParamsuntil it isnull, accumulating all pages before persisting — mirroring the pagination pattern already used byPostRsRestClient. The page size is not a cap: a site with hundreds of categories is fetched across multiple requests until exhausted.This only touches the wp-rs/application-password path. The WP.com (
TaxonomyRestClient,number=1000) and XML-RPC paths are unaffected.Testing instructions
Fetch all categories:
Fetched category list: <full count>rather thanFetched category list: 10.