-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Posts: we aren't showing post-counts for Jetpack sites #32
Comments
lancewillett
changed the title
Posts: we aren't showing post-counts for jetpack sites
Posts: we aren't showing post-counts for Jetpack sites
Oct 5, 2016
lancewillett
modified the milestones:
Jetpack Sites and Posts Parity,
Jetpack in Calypso Parity ("Mind the Gaps")
May 11, 2017
I believe post counts work just fine for Jetpack sites in Calypso now. If there are any other bugs or improvements, let's open as new issues in GitHub. |
sirreal
pushed a commit
that referenced
this issue
Dec 5, 2018
Add rule for enforcing import docblocks
sirreal
pushed a commit
that referenced
this issue
Dec 5, 2018
Add rule for enforcing import docblocks
sirreal
pushed a commit
that referenced
this issue
Dec 6, 2018
Add rule for enforcing import docblocks
sirreal
pushed a commit
that referenced
this issue
Dec 11, 2018
Add rule for enforcing import docblocks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We turned the post-counts filtering feature (i.e., show the post-counts in the status selector and don't show statuses with a zero post-count) off for jetpack sites because our current implementation only supports post-counts on public posts (because that's all that gets synced right now).
So we somehow need to enable this for jetpack sites as well. This could be done by implementing the post-counts endpoint in the jetpack plugin itself (versus the
post_process_jetpack_response
we are currently using). It's already implemented to some point, but isn't up-to-date or working correctly.I noticed that the post-counts endpoint code in the jetpack plugin wasn't updated with the latest changes. So I started a branch to make the relevant changes here.
https://github.com/Automattic/jetpack/compare/update/reshape-post-count-response
Notice that I also removed the
force: true
, which effectively forces thepublic-api.wordpress.com
to run the code against our shadow blog (which only contains public posts), versus forwarding on the request to the jetpack site's API. I also changed the shape of thepost-counts
response because for some reasoncast_and_filter
was not happy with the double-nesting of arrays. These jetpack changes also need to be coordinated with corresponding updates in wpcom, which I have set up in a phabricator instance here: D181-codeWith these two changes together, I can get the correct data for
post-counts
for a jetpack site when I query thepost-counts
endpoint directly. Yay!However, we don't query the
post-counts
endpoint directly, we do it via meta-expansion from the post-lists endpoint. And if I am obtainingpost-counts
data via meta expansion from thepost-lists
endpoint (i.e., /v1.1/sites/:site/posts?meta=counts
), the meta query is run against the shadow blog, so we still only get partial data (i.e., only counts for published posts). I think this may be a limitation of how meta expanded queries are processed. I haven't figured that out yet.So we either need to get the meta expanded query to hit the jetpack site directly, or we need to separate our API queries for posts and post-counts (at least for jetpack sites).
And of course all of this will need to be coordinated with corresponding changes to wpcom.js and jetpack.
The text was updated successfully, but these errors were encountered: