Release - #1110
Open
selul wants to merge 11 commits into
Open
Conversation
Fixes four defects in the publish-now queue reported in #1102: - WP_Query ignores numberposts, so the drain batch silently fell back to the posts_per_page option; use posts_per_page => 300 - queue entries had no staleness cutoff, so a stalled cron blasted months-old posts on recovery; entries older than a filterable rop_publish_now_expiration (default 1 day) are now marked expired instead of shared - routine edits of already-published posts re-queued shares from leftover meta; wp_after_insert_post now only queues on new publishes unless the classic metabox explicitly submits publish_now - entries with no accounts left rop_publish_now_status stuck at queued forever; the status is now cleared when they are skipped Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PHPUnit (tests/test-publish-now.php, new `publish-now` suite): 8 of the 15 tests fail on unfixed development, one per defect — stale entries sharing, a backlog delaying the fresh post, the batch capped at posts_per_page, orphan entries stuck at queued, an edit of a published post re-queueing, and the metabox pre-checking itself on archive content. The other 7 are guards for the paths that must keep sharing: publishing a draft, a scheduled post going live, an explicit Classic Editor submit, and the Block Editor re-share action. The edit test clears `rop_maybe_publish_now_<id>` first. Publishing sets that transient for a minute, so without clearing it the test passes on unfixed code for the wrong reason instead of exercising the defect. E2E (publish-now-backlog.spec.js): seeds three months-old queue entries via a new `/queued-post` endpoint, publishes a post through the editor and asserts the mocked X API only ever receives the fresh one. On unfixed code all four posts are shared — the customer's flood. A second test shares an entry queued seconds ago so the expiry cannot regress into dropping legitimate shares. Also clears leftover `rop_publish_now_history` in `/reset`, which otherwise leaks between runs, and adds `/publish-now-state` so tests can assert on queue meta rather than on editor UI a cron run can erase. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- reschedule another drain pass when a full batch is consumed, so a fresh post behind a large stale backlog is not stranded until an unrelated share event (batch size now filterable via rop_publish_now_batch_size) - retire orphaned entries (no accounts left) through the expiration path so their queued history rows are cleared and the editor stops polling forever - skip re-queueing on ordinary saves of a post with a pending share: the Classic metabox keeps publish_now checked, and refreshing the history timestamp let stalled entries evade the expiration cutoff Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Enforced maximum post age when sharing queued posts
fix: expire stale Instant Sharing queue entries instead of flooding accounts
Contributor
* fix: improve API response handling to prevent data loss * fix: enhance error handling * fix: use instance context in error handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR merges the latest changes from
developmentintomaster.Linked issues
This release will close the following issues once merged:
Public changelog