[
https://issues.apache.org/jira/browse/UNOMI-1004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18127613#comment-18127613
]
Serge Huber commented on UNOMI-1004:
------------------------------------
Pull request: https://github.com/apache/unomi/pull/919
Boolean OR now omits sub-conditions whose optional parameter is unset. An OR
with no remaining branches matches nothing. AND still omits unset optionals
(UNOMI-982). The same pruning is in the Elasticsearch and OpenSearch boolean
query builders.
Unit tests cover hover-like only-id / only-path / both / neither, generic
OR/AND optional cases, and both query builders.
> A hover condition with only a target id matches every hover event
> -----------------------------------------------------------------
>
> Key: UNOMI-1004
> URL: https://issues.apache.org/jira/browse/UNOMI-1004
> Project: Apache Unomi
> Issue Type: Bug
> Affects Versions: unomi-4.0.0
> Reporter: Serge Huber
> Assignee: Serge Huber
> Priority: Major
> Fix For: unomi-4.0.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> h3. Summary
> The hover event condition matches when either the target id or the target
> path matches (since UNOMI-828). Since UNOMI-982, a part of a condition whose
> parameter is not set counts as "always true".
> The two changes together mean that a hover condition with only a target id,
> or only a target path, matches every hover event. A segment or rule that uses
> it then applies to everyone.
> The goal of this ticket is that the condition only checks the parameters that
> are set.
> h3. Ways to explore
> * Leave out the parts of an "or" whose parameter is not set. If no parameter
> is set at all, the condition must match nothing, or be refused when it is
> saved. It must not match everything.
> * Look for other built-in conditions that combine optional parameters with
> "or".
> h3. How to test
> Manual check: create hover events on two different targets. A condition with
> only the target id of the first one must match only the first event.
> Automated tests to add, both for the in-memory evaluation and for the
> Elasticsearch and OpenSearch queries (condition evaluator and query builder
> integration tests). Each must fail on the 4.0.0 release candidate and pass
> once the fix is in:
> * Hover condition with only a target id, only a target path, both, and
> neither. Each matches exactly the expected events. With neither, it matches
> nothing or is refused when saved.
> * A generic "or" condition with optional parameters: unset parts are left
> out, and an "or" with no parts left never matches everything.
> * The same cases for any other built-in condition found that combines
> optional parameters with "or".
> * The existing tests for UNOMI-982 (unset parameters in an "and") still pass.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)