Merge branch 'dev' into live-se-red

This commit is contained in:
nick-delirium 2024-12-30 12:48:37 +01:00
commit d3acbdcc1b
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
5 changed files with 17 additions and 43 deletions

View file

@ -11,6 +11,7 @@ from chalicelib.utils import sql_helper as sh
logger = logging.getLogger(__name__)
def search2_series(data: schemas.SessionsSearchPayloadSchema, project_id: int, density: int,
metric_type: schemas.MetricType, metric_of: schemas.MetricOfTimeseries | schemas.MetricOfTable,
metric_value: List):
@ -1307,7 +1308,6 @@ def search_query_parts_ch(data: schemas.SessionsSearchPayloadSchema, error_statu
return full_args, query_part
def get_user_sessions(project_id, user_id, start_date, end_date):
with pg_client.PostgresClient() as cur:
constraints = ["s.project_id = %(projectId)s", "s.user_id = %(userId)s"]
@ -1385,29 +1385,4 @@ def session_exists(project_id, session_id):
# TODO: support this for CH
def check_recording_status(project_id: int) -> dict:
query = f"""
WITH project_sessions AS (SELECT COUNT(1) AS full_count,
COUNT(1) FILTER ( WHERE duration IS NOT NULL) AS nn_duration_count
FROM public.sessions
WHERE project_id = %(project_id)s
AND start_ts >= (extract(EPOCH FROM now() - INTERVAL '1 day')) * 1000
AND start_ts <= (extract(EPOCH FROM now() + INTERVAL '1 day')) * 1000)
SELECT CASE
WHEN full_count = 0 THEN 0
WHEN nn_duration_count = 0 THEN 1
ELSE 2
END AS recording_status,
full_count AS sessions_count
FROM project_sessions;
"""
with pg_client.PostgresClient() as cur:
query = cur.mogrify(query, {"project_id": project_id})
cur.execute(query)
row = cur.fetchone()
return {
"recordingStatus": row["recording_status"],
"sessionsCount": row["sessions_count"]
}
return sessions_legacy.check_recording_status(project_id=project_id)

View file

@ -4,7 +4,7 @@ from decouple import config
from fastapi import Depends, Body, BackgroundTasks
import schemas
from chalicelib.core import sourcemaps, events, projects, issues, metadata, reset_password, log_tools, sessions, \
from chalicelib.core import sourcemaps, events, projects, issues, metadata, reset_password, log_tools, \
announcements, weekly_report, assist, mobile, tenants, boarding, notifications, webhook, users, saved_search, tags
from chalicelib.core.metrics import custom_metrics
from chalicelib.core.alerts import alerts
@ -13,7 +13,7 @@ from chalicelib.core.issue_tracking import github, integrations_global, integrat
jira_cloud
from chalicelib.core.log_tools import datadog, newrelic, stackdriver, elasticsearch, \
sentry, bugsnag, cloudwatch, sumologic, rollbar
from chalicelib.core.sessions import sessions_assignments
from chalicelib.core.sessions import sessions_assignments, sessions
from chalicelib.core.collaborations.collaboration_msteams import MSTeams
from chalicelib.core.collaborations.collaboration_slack import Slack
from or_dependencies import OR_context, OR_role

View file

@ -58,7 +58,6 @@ android {
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
}
buildTypes {
@ -91,16 +90,7 @@ dependencies {
//noinspection GradleDynamicVersion
implementation("com.facebook.react:react-native:0.20.1")
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
implementation("com.github.openreplay:android-tracker:v1.1.4")
implementation("com.github.openreplay:android-tracker:v1.1.6")
}
//allprojects {
// repositories {
// maven { url = uri("https://jitpack.io") }
// google()
// mavenCentral()
// }
//}

View file

@ -104,7 +104,16 @@ class ReactNativeModule(reactContext: ReactApplicationContext) :
status: Int,
duration: Double
) {
val durationULong = duration.toLong().toULong()
OpenReplay.networkRequest(url, method, requestJSON, responseJSON, status, durationULong)
// val durationLong: Long = duration.toLong()
val durationULong: ULong = duration.toLong().toULong()
OpenReplay.networkRequest(
url = url,
method = method,
requestJSON = requestJSON,
responseJSON = responseJSON,
status = status,
duration = durationULong
)
}
}

View file

@ -1,6 +1,6 @@
{
"name": "@openreplay/react-native",
"version": "0.6.11",
"version": "0.6.13",
"description": "Openreplay React-native connector for iOS applications",
"main": "lib/commonjs/index",
"module": "lib/module/index",