[
https://issues.apache.org/jira/browse/UNOMI-1015?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jonathan Sinovassin-Naïk reassigned UNOMI-1015:
-----------------------------------------------
Assignee: Jonathan Sinovassin-Naïk
> Empty boolean condition does not match the same items in rules and in searches
> ------------------------------------------------------------------------------
>
> Key: UNOMI-1015
> URL: https://issues.apache.org/jira/browse/UNOMI-1015
> Project: Apache Unomi
> Issue Type: Bug
> Components: unomi(-core)
> Affects Versions: unomi-2.7.0, unomi-4.0.0, unomi-3.0.1
> Reporter: Serge Huber
> Assignee: Jonathan Sinovassin-Naïk
> Priority: Minor
> Fix For: unomi-4.1.0, unomi-3.1.0
>
>
> h3. Summary
> A boolean condition with an empty list of sub-conditions does not give the
> same answer everywhere. In rules and other in-memory checks, an empty AND
> matches every item and an empty OR matches nothing. In searches and segment
> queries, both match every item. This has been the case since at least the 2.x
> line.
> The goal of this ticket is to give an empty list one meaning on every path.
> Callers that use an empty OR to mean "all event types" need to keep working.
> h3. Background
> This relates to UNOMI-1004 (pull request 919) and UNOMI-982. UNOMI-1004
> briefly made an empty OR match nothing in queries as well. That broke code
> that builds an OR with one branch per event type and treats an empty type
> list as "all types". Profile merge then stopped moving existing session
> events to the anonymous profile, and a session events request with no event
> types would have returned no events. UNOMI-1004 therefore kept the older
> query result for a completely empty list. Only an OR whose branches are all
> unset optional parameters matches nothing.
> A missing sub-conditions list should be treated the same way as an empty
> list. On the 3.0.x line, the query builders currently fail when the list is
> missing.
> The migration notes should say that a stored segment, scoring plan, or search
> that uses an empty OR will stop matching every item in queries. Callers that
> want every item should use a match-all condition.
> h3. Ways to explore
> * Find internal callers that build a boolean condition from a list that can
> be empty, and stop them from depending on the current query result.
> * Make the in-memory check and the Elasticsearch and OpenSearch query
> builders agree.
> * Cover the empty-list cases in the condition tests, so the in-memory path
> and the query path are checked against each other.
> h3. How to test
> * Check that an empty AND matches every item, and an empty OR matches no
> item, both in memory and as a query on both engines.
> * Check that searching session events with no event types still returns every
> event of the session.
> * Check that profile merge still rewrites existing session events, and that
> the session events endpoint still works when no event types are given.
> * Run the condition integration tests.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)