fix(2meet-data-optimizer): drift checks only where native meta is authoritative
- In aeav_only flat is the source of truth and native meta is stale by design, so drift there means nothing: drift-check --fix refuses (it would overwrite current flat values with stale native ones), the daily sample skips such entities, and the router keeps routing a drifting group instead of falling back to stale native meta. - Found before PR-074 on hardening/2.2 (PR-071–073 not released; dev21 still runs aeav_only). - Verify: DriftCheckTest / PostQueryRouterDriftTest aeav_only cases (RED before); dev36 fix() in a simulated aeav_only refused. - PR: PR-073b
This commit is contained in:
@@ -100,6 +100,23 @@ class PostQueryRouterDriftTest extends TestCase {
|
||||
$this->assertNotEmpty( $query->get( 'wpdo_post_clauses' ) );
|
||||
}
|
||||
|
||||
public function test_aeav_only_ignores_drift_because_native_is_stale_by_design(): void {
|
||||
self::set_modes(
|
||||
array(
|
||||
'post' => 'aeav_only',
|
||||
'user' => 'disabled',
|
||||
'term' => 'disabled',
|
||||
'comment' => 'disabled',
|
||||
)
|
||||
);
|
||||
$this->drift( 'wc_product', 3 );
|
||||
$query = $this->price_query();
|
||||
|
||||
( new WPDO_Post_Query_Router() )->pre_get_posts( $query );
|
||||
|
||||
$this->assertNotEmpty( $query->get( 'wpdo_post_clauses' ) );
|
||||
}
|
||||
|
||||
public function test_sorting_by_a_drifting_key_stays_native(): void {
|
||||
$this->drift( 'wc_product', 1 );
|
||||
$query = new WP_Query();
|
||||
|
||||
Reference in New Issue
Block a user