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

(cherry picked from commit 62ef3ca2dd)
This commit is contained in:
Kraiem Taha Yassine 2024-09-25 17:25:18 +02:00 committed by Taha Yassine Kraiem
parent 246d186816
commit b91762cb09
4 changed files with 25 additions and 12 deletions

View file

@ -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

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:
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)

View file

@ -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

View file

@ -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"