Repository navigation
Social: Share posts when no connections are skipped - #55572
Conversation
Always send the skip list from the share-post ability, even when it's empty. WordPress.com drops the queued share without it. Also read a single ID or comma-separated string, so accounts the caller asks to skip stay skipped.
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Social plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
|
Phan can't tell that the decoded JSON is an array, so it failed static analysis.
There was a problem hiding this comment.
🟡 Changes recommended
Approval is blocked by an unreachable scalar-input normalization caused by the still-array schema, plus missing corresponding changelog entries in the Social and Jetpack plugins.
2 open issues
What changed in this PR
Fixes Jetpack Social post sharing by ensuring queued requests always include a normalized skipped_connections payload.
Changes:
- Always sends
skipped_connections, including when the list is empty. - Normalizes array, single-ID, and comma-separated connection inputs.
- Adds parameterized tests for skip-list handling and skipped-only connections.
- Documents the fix in the Publicize package changelog.
| File | Description |
|---|---|
| projects/packages/publicize/tests/php/abilities/Social_Abilities_Test.php | Adds parameterized tests covering empty, array, scalar, comma-separated, duplicate, and skipped-only connection inputs. |
| projects/packages/publicize/src/abilities/class-social-abilities.php | Normalizes skipped connection IDs and includes the resulting list in every queued share request. |
| projects/packages/publicize/changelog/fix-social-share-post-ability-skipped-connections | Documents the Jetpack Social share-post queueing fix. |
Review effort: Lite
Jetpack and Social both expose the ability, so their users need to see the fix in each plugin's changelog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lezama
left a comment
There was a problem hiding this comment.
matches the wpcom side, which only sends to every connection when it gets an empty array. wp_parse_id_list() also casts and dedupes, so the strict in_array() below compares ints now. looks good.
There was a problem hiding this comment.
Tested this on a Jurassic Ninja site with the branch build and a Facebook page connected, going through the WordPress.com MCP connector, and it does what it says.
One thing I wanted to check with you: now that the empty list goes through, a share with no skipped_connections goes to every connection the user can use, including ones the author switched off for that post. The editor turns those toggles into the skip list, but the ability doesn't. If that's intended, could the ability description mention it? Otherwise the default could come from the post's sharing toggles.
Also, I'm wondering if the REST counterpart route also needs the same fix ? (should we file an issue with the team?)
The toggles you set on a draft are saved and apply when the post is first published, but not to later shares. On a published post, the block editor toggles only affect shares you make from the editor, and they aren't saved. Updated the ability description. |
Say in the ability description that the editor toggles have no effect, so agents know where a share goes. Cover rejected and spaced skip lists, and reword the Social changelog entry for people who use the plugin.
…pack-social-share-queued-5d3a44 # Conflicts: # projects/packages/publicize/src/abilities/class-social-abilities.php
Publishing shares to the connections switched on for the post, so an agent that then calls share-post can post duplicates. Say so in the ability description.


Fixes MCP-1497
Proposed changes
skipped_connectionsfromjetpack-social/share-post, as[]when there's nothing to skip. WordPress.com drops the queued share without it.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Install this branch on a JN site and connect a social network: /wp-admin/admin.php?page=jetpack-social
Publish a post to the social network (replace the ID with the ID of the post you want to publish):
Check that the post appears on the network and in the editor's Sharing activity. On trunk, it never appears.
Get the
connection_id:Run
share-postagain with that ID as a string (replace123):Check that it returns
jetpack_social_no_connectionsand shares nothing.Ask your connected agent to publish the post to your connected network and confirm it succeeds.