fix(2meet-data-optimizer): give new posts' flat rows their status/date copies; sync drops cached counts

- add_flat_rows (wp_insert_post, after transition_post_status) inserts the
  copies with the empty row: a NULL copy turned the copy route off for the
  whole group until the next sync
- wp tmdo post-status-sync bumps the routed count version (not on dry runs)
- Test bootstrap: minimal WP_Post stub
- Found in the 2.4 correctness review (residual risks)
- Verify: 2 new integration tests; integration 606, unit 704, phpcs 0, stan OK
- PR: PR-133
This commit is contained in:
2026-09-28 00:32:59 +08:00
parent 80343ec282
commit 3e96357459
5 changed files with 53 additions and 2 deletions
@@ -163,6 +163,10 @@ final class TMDO_Post_Status_Sync {
}
self::set_state( $group, 'ready' );
}
// Routed counts cached while the copies were stale must go.
if ( ! $dry_run && class_exists( 'TMDO_Post_Query_Router' ) ) {
TMDO_Post_Query_Router::bump_count_version();
}
return $report;
}