From e5ce58438ecc7a4824327ab828a1730a3cd30896 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Wed, 15 Feb 2023 16:51:38 +0100 Subject: [PATCH] feat(chalice): limit exp-search to 7 events for then-events --- ee/api/chalicelib/core/sessions_exp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ee/api/chalicelib/core/sessions_exp.py b/ee/api/chalicelib/core/sessions_exp.py index 35eabad5d..f60090ed4 100644 --- a/ee/api/chalicelib/core/sessions_exp.py +++ b/ee/api/chalicelib/core/sessions_exp.py @@ -1176,6 +1176,9 @@ def search_query_parts_ch(data: schemas.SessionsSearchPayloadSchema, error_statu ) {"" if or_events else (f"AS event_{event_index} " + ("ON(TRUE)" if event_index > 0 else ""))}\ """) event_index += 1 + # limit THEN-events to 7 in CH because sequenceMatch cannot take more arguments + if event_index == 7 and data.events_order == schemas.SearchEventOrder._then: + break if event_index < 2: data.events_order = schemas.SearchEventOrder._or