From baf392f334742c5d159beb34a305b6eab00073aa Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Fri, 28 Oct 2022 19:19:26 +0200 Subject: [PATCH 1/4] feat(chalice): added PYTHONUNBUFFERED env var --- api/env.default | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/env.default b/api/env.default index 64243ed0b..82419328c 100644 --- a/api/env.default +++ b/api/env.default @@ -49,4 +49,5 @@ SESSION_MOB_PATTERN_E=%(sessionId)s/dom.mobe DEVTOOLS_MOB_PATTERN=%(sessionId)s/devtools.mobs PRESIGNED_URL_EXPIRATION=3600 ASSIST_JWT_EXPIRATION=144000 -ASSIST_JWT_SECRET= \ No newline at end of file +ASSIST_JWT_SECRET= +PYTHONUNBUFFERED=1 \ No newline at end of file From 795239a8a5ba458b2e047bdc7eee4e5c58c1d3be Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Fri, 28 Oct 2022 19:27:49 +0200 Subject: [PATCH 2/4] feat(chalice): sourcemaps log --- api/chalicelib/core/sourcemaps.py | 1 + 1 file changed, 1 insertion(+) diff --git a/api/chalicelib/core/sourcemaps.py b/api/chalicelib/core/sourcemaps.py index 147304a4e..ed3c63e07 100644 --- a/api/chalicelib/core/sourcemaps.py +++ b/api/chalicelib/core/sourcemaps.py @@ -147,6 +147,7 @@ MAX_COLUMN_OFFSET = 60 def fetch_missed_contexts(frames): source_cache = {} + print(f">>>>>>>> fetch_missed_contexts of: {len(frames)} frames") for i in range(len(frames)): print(">>>>>>>> fetch_missed_contexts exception:") print(frames[i]) From 366b03161e190c292468fd88aeae2ae3a433273e Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Mon, 31 Oct 2022 11:09:49 +0100 Subject: [PATCH 3/4] feat(DB): file_key column refactored for multi-run --- .../schema/db/init_dbs/postgresql/1.8.2/1.8.2.sql | 3 ++- .../schema/db/init_dbs/postgresql/init_schema.sql | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ee/scripts/schema/db/init_dbs/postgresql/1.8.2/1.8.2.sql b/ee/scripts/schema/db/init_dbs/postgresql/1.8.2/1.8.2.sql index 9742cd426..a144f3a1d 100644 --- a/ee/scripts/schema/db/init_dbs/postgresql/1.8.2/1.8.2.sql +++ b/ee/scripts/schema/db/init_dbs/postgresql/1.8.2/1.8.2.sql @@ -60,6 +60,7 @@ BEGIN END; $$ LANGUAGE plpgsql; -ALTER TABLE sessions ADD file_key BYTEA NULL; +ALTER TABLE IF EXISTS sessions + ADD COLUMN IF NOT EXISTS file_key BYTEA DEFAULT NULL; COMMIT; \ No newline at end of file diff --git a/ee/scripts/schema/db/init_dbs/postgresql/init_schema.sql b/ee/scripts/schema/db/init_dbs/postgresql/init_schema.sql index a3d403b44..866a0e7d5 100644 --- a/ee/scripts/schema/db/init_dbs/postgresql/init_schema.sql +++ b/ee/scripts/schema/db/init_dbs/postgresql/init_schema.sql @@ -545,11 +545,12 @@ $$ watchdogs_score bigint NOT NULL DEFAULT 0, issue_score bigint NOT NULL DEFAULT 0, issue_types issue_type[] NOT NULL DEFAULT '{}'::issue_type[], - utm_source text NULL DEFAULT NULL, - utm_medium text NULL DEFAULT NULL, - utm_campaign text NULL DEFAULT NULL, - referrer text NULL DEFAULT NULL, - base_referrer text NULL DEFAULT NULL, + utm_source text DEFAULT NULL, + utm_medium text DEFAULT NULL, + utm_campaign text DEFAULT NULL, + referrer text DEFAULT NULL, + base_referrer text DEFAULT NULL, + file_key bytea DEFAULT NULL, metadata_1 text DEFAULT NULL, metadata_2 text DEFAULT NULL, metadata_3 text DEFAULT NULL, From 90d6dfb1af823863865038cafe3c371e36156a0b Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Mon, 31 Oct 2022 13:12:43 +0100 Subject: [PATCH 4/4] feat(chalice): check for context existance for errors --- api/chalicelib/core/sourcemaps.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/api/chalicelib/core/sourcemaps.py b/api/chalicelib/core/sourcemaps.py index ed3c63e07..886198e35 100644 --- a/api/chalicelib/core/sourcemaps.py +++ b/api/chalicelib/core/sourcemaps.py @@ -147,12 +147,8 @@ MAX_COLUMN_OFFSET = 60 def fetch_missed_contexts(frames): source_cache = {} - print(f">>>>>>>> fetch_missed_contexts of: {len(frames)} frames") for i in range(len(frames)): - print(">>>>>>>> fetch_missed_contexts exception:") - print(frames[i]) - print("------------------") - if len(frames[i]["context"]) > 0: + if frames[i] and frames[i].get("context") and len(frames[i]["context"]) > 0: continue file_abs_path = frames[i]["frame"]["absPath"] if file_abs_path in source_cache: