Patch/api v1.20.0 (#2610)

* fix(chalice): remove null referrer from table of referrers

* fix(chalice): fixed add MSTeams integration with wrong URL

* fix(chalice): session's search ignore injected durations
This commit is contained in:
Kraiem Taha Yassine 2024-09-25 17:25:18 +02:00 committed by GitHub
parent 9d0f3b34ae
commit 62ef3ca2dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 12 deletions

View file

@ -26,17 +26,23 @@ class MSTeams(BaseCollaboration):
@classmethod @classmethod
def say_hello(cls, url): def say_hello(cls, url):
r = requests.post( try:
url=url, r = requests.post(
json={ url=url,
"@type": "MessageCard", json={
"@context": "https://schema.org/extensions", "@type": "MessageCard",
"summary": "Welcome to OpenReplay", "@context": "https://schema.org/extensions",
"title": "Welcome to OpenReplay" "summary": "Welcome to OpenReplay",
}) "title": "Welcome to OpenReplay"
if r.status_code != 200: },
logger.warning("MSTeams integration failed") timeout=3)
logger.warning(r.text) 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 False
return True return True

View file

@ -336,10 +336,13 @@ def search2_table(data: schemas.SessionsSearchPayloadSchema, project_id: int, de
if v not in extra_conditions[e.operator].value: if v not in extra_conditions[e.operator].value:
extra_conditions[e.operator].value.append(v) extra_conditions[e.operator].value.append(v)
extra_conditions = list(extra_conditions.values()) extra_conditions = list(extra_conditions.values())
elif metric_of == schemas.MetricOfTable.ISSUES and len(metric_value) > 0: elif metric_of == schemas.MetricOfTable.ISSUES and len(metric_value) > 0:
data.filters.append(schemas.SessionSearchFilterSchema(value=metric_value, type=schemas.FilterType.ISSUE, data.filters.append(schemas.SessionSearchFilterSchema(value=metric_value, type=schemas.FilterType.ISSUE,
operator=schemas.SearchEventOperator.IS)) 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, full_args, query_part = search_query_parts(data=data, error_status=None, errors_only=False,
favorite_only=False, issue=None, project_id=project_id, favorite_only=False, issue=None, project_id=project_id,
user_id=None, extra_event=extra_event, extra_conditions=extra_conditions) user_id=None, extra_event=extra_event, extra_conditions=extra_conditions)

View file

@ -777,6 +777,9 @@ class SessionsSearchPayloadSchema(_TimedSchema, _PaginatedSchema):
for f in values.get("filters", []): for f in values.get("filters", []):
vals = [] vals = []
for v in f.get("value", []): for v in f.get("value", []):
if f.get("type", "") == FilterType.DURATION.value \
and not v.isnumeric():
continue
if v is not None: if v is not None:
vals.append(v) vals.append(v)
f["value"] = vals f["value"] = vals

View file

@ -450,6 +450,7 @@ def search2_table(data: schemas.SessionsSearchPayloadSchema, project_id: int, de
elif metric_of == schemas.MetricOfTable.REFERRER: elif metric_of == schemas.MetricOfTable.REFERRER:
main_col = "referrer" main_col = "referrer"
extra_col = ", referrer" extra_col = ", referrer"
extra_where = "WHERE isNotNull(referrer)"
elif metric_of == schemas.MetricOfTable.FETCH: elif metric_of == schemas.MetricOfTable.FETCH:
main_col = "url_path" main_col = "url_path"
extra_col = ", s.url_path" extra_col = ", s.url_path"