fix: date filter parameters collide across OR clauses#1596
Conversation
When a date filter had multiple OR clauses (filters.valid_at is a list of
lists), each OR clause's inner-loop counter j reset to 0. Parameters were
keyed as 'valid_at_0', 'valid_at_1', etc., so each OR clause overwrote the
previous clause's parameter values. The Cypher query then used the wrong
dates for all but the last OR clause.
Fix: key by f'{field}_{i}_{j}' (outer OR index i + inner AND index j) for
all four date fields: valid_at, invalid_at, created_at, expired_at.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: example@example.com or I have read the CLA Document and I hereby sign the CLA behalf of my company, e-mail: example@example.com Signature is valid for 6 months. This bot will be retriggered when the Contributor License Agreement comment has been provided. Posted by the CLA Assistant Lite bot. |
|
I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: totto@exoreaction.com |
What
In
build_edge_search_filter_query(), date filter parameters are keyed by only the inner-loop indexj, not by the outer OR-clause indexi:When
filters.valid_athas more than one OR clause, each clause resetsjto 0. OR clause 1 overwrites OR clause 0's parameter values. The Cypher query then uses the wrong date values for all but the last OR clause.Why it matters
Any temporal filter with multiple OR conditions silently applies the last clause's dates to all clauses, producing incorrect query results without any error.
The same bug exists in all four date fields:
valid_at,invalid_at,created_at,expired_at.Fix
Key by both
i(OR-clause) andj(AND-condition within clause):Applied to all four date fields.
Reproducer