Skip to main content

duplicate_items_do_not_duplicate_events

Function duplicate_items_do_not_duplicate_events 

pub async fn duplicate_items_do_not_duplicate_events<F: Fixture>(
    open: impl AsyncFn() -> F,
) -> RuleOutcome
Expand description

An event matching several items, or carrying several tags, is yielded once.

ES-15 and CF-9. The store holds one event carrying three tags, and the rule reads it twice: through Query::all(), where a row-per-tag side table joined without DISTINCT fans it out into three rows, and through a two-item query both of whose items match it, where an OR implemented as one statement per item unioned with UNION ALL returns it twice.

The Query::all() half is the one nothing else in the suite could reach: every other rule that reads Query::all() does so over untagged events, where a fan-out join produces exactly one row per event and the defect is invisible. TagJoinFanOutStore is the compiled version.