• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / duplicate-post / 23666031844

27 Mar 2026 08:24PM UTC coverage: 59.598%. First build
23666031844

push

github

enricobattocchi
fix(duplicator): prevent race condition in R&R copy creation

Claim the slot on the original post using add_post_meta() with
$unique = true before creating the copy. This returns false if the
meta key already exists, preventing duplicate copies when two concurrent
requests both pass the permission check before either sets the meta.

If wp_insert_post() fails, the claim is rolled back by deleting the
meta.

Also fixes Block_Editor_Test to mock get_post_type_object() for the
restBase addition to the localized JS object.

Ref: Yoast/reserved-tasks#1127

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

8 of 14 new or added lines in 1 file covered. (57.14%)

1630 of 2735 relevant lines covered (59.6%)

7.26 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.04
/src/post-duplicator.php


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc