diff --git a/api/chalicelib/core/collaboration_msteams.py b/api/chalicelib/core/collaboration_msteams.py index cea284cd8..b94cc42f9 100644 --- a/api/chalicelib/core/collaboration_msteams.py +++ b/api/chalicelib/core/collaboration_msteams.py @@ -26,17 +26,23 @@ class MSTeams(BaseCollaboration): @classmethod def say_hello(cls, url): - r = requests.post( - url=url, - json={ - "@type": "MessageCard", - "@context": "https://schema.org/extensions", - "summary": "Welcome to OpenReplay", - "title": "Welcome to OpenReplay" - }) - if r.status_code != 200: - logger.warning("MSTeams integration failed") - logger.warning(r.text) + try: + r = requests.post( + url=url, + json={ + "@type": "MessageCard", + "@context": "https://schema.org/extensions", + "summary": "Welcome to OpenReplay", + "title": "Welcome to OpenReplay" + }, + timeout=3) + if r.status_code != 200: + logger.warning("MSTeams integration failed") + logger.warning(r.text) + return False + except Exception as e: + logger.warning("!!! MSTeams integration failed") + logger.exception(e) return False return True diff --git a/api/chalicelib/core/sessions.py b/api/chalicelib/core/sessions.py index d683f7b6f..1b93b5c89 100644 --- a/api/chalicelib/core/sessions.py +++ b/api/chalicelib/core/sessions.py @@ -336,10 +336,13 @@ def search2_table(data: schemas.SessionsSearchPayloadSchema, project_id: int, de if v not in extra_conditions[e.operator].value: extra_conditions[e.operator].value.append(v) extra_conditions = list(extra_conditions.values()) - elif metric_of == schemas.MetricOfTable.ISSUES and len(metric_value) > 0: data.filters.append(schemas.SessionSearchFilterSchema(value=metric_value, type=schemas.FilterType.ISSUE, operator=schemas.SearchEventOperator.IS)) + elif metric_of == schemas.MetricOfTable.REFERRER: + data.filters.append(schemas.SessionSearchFilterSchema(value=metric_value, type=schemas.FilterType.REFERRER, + operator=schemas.SearchEventOperator.IS_ANY)) + full_args, query_part = search_query_parts(data=data, error_status=None, errors_only=False, favorite_only=False, issue=None, project_id=project_id, user_id=None, extra_event=extra_event, extra_conditions=extra_conditions) diff --git a/api/schemas/schemas.py b/api/schemas/schemas.py index 985bb1d7a..34f49d2df 100644 --- a/api/schemas/schemas.py +++ b/api/schemas/schemas.py @@ -777,6 +777,9 @@ class SessionsSearchPayloadSchema(_TimedSchema, _PaginatedSchema): for f in values.get("filters", []): vals = [] for v in f.get("value", []): + if f.get("type", "") == FilterType.DURATION.value \ + and not v.isnumeric(): + continue if v is not None: vals.append(v) f["value"] = vals diff --git a/ee/api/chalicelib/core/sessions_exp.py b/ee/api/chalicelib/core/sessions_exp.py index 3e6d1ec10..0654f03c7 100644 --- a/ee/api/chalicelib/core/sessions_exp.py +++ b/ee/api/chalicelib/core/sessions_exp.py @@ -450,6 +450,7 @@ def search2_table(data: schemas.SessionsSearchPayloadSchema, project_id: int, de elif metric_of == schemas.MetricOfTable.REFERRER: main_col = "referrer" extra_col = ", referrer" + extra_where = "WHERE isNotNull(referrer)" elif metric_of == schemas.MetricOfTable.FETCH: main_col = "url_path" extra_col = ", s.url_path"