Skip to content

Conversation

@crazytonyli
Copy link
Contributor

Relates to wordpress-mobile/GutenbergKit#299 (comment).

wp/v2/posts?status=any response's "next link" is not parsed correctly at the moment. The "next link" contains "status[0]=any", whereas the library (the get_csv function specifically) looks for the status key. This results in the status query being lost.

I have added an integration test to this PR, and Claude Code added some unit test to verify the fix.

@crazytonyli crazytonyli requested a review from jkmassel February 2, 2026 02:52
}

#[test]
fn test_get_csv_with_php_array_stops_at_gap() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it should work this way – PHP makes it really easy to end up with a valid state that looks like this (by using array_unique for instance). If the server sends back status[0]=draft&status[4]=publish&status[4234]=pending, we know what it means, and I think we should handle it properly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in d863162.

@crazytonyli crazytonyli requested a review from jkmassel February 3, 2026 00:48
@crazytonyli crazytonyli merged commit 3fcb22a into trunk Feb 3, 2026
23 checks passed
@crazytonyli crazytonyli deleted the bugfix/parse-status-list-in-next-link branch February 3, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants