From c9ca15e81521e2e1af55ecb8742c2fb3ec8817f3 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 10 Jul 2024 00:25:30 +0100 Subject: [PATCH 1/2] [Session] Include stack with the debug event --- src/state/session/logging.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/state/session/logging.ts b/src/state/session/logging.ts index 9a703957d6..b57f1fa0b0 100644 --- a/src/state/session/logging.ts +++ b/src/state/session/logging.ts @@ -76,7 +76,12 @@ export function addSessionErrorLog(did: string, event: AtpSessionEvent) { if (!Statsig.initializeCalled() || !Statsig.getStableID()) { return } - Statsig.logEvent('session:error', null, {did, event}) + const stack = (new Error().stack ?? '').slice(0, MAX_SLICE_LENGTH) + Statsig.logEvent('session:error', null, { + did, + event, + stack, + }) } catch (e) { console.error(e) } From afa4254e01278a3392819d67375628e341b5345c Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 10 Jul 2024 00:28:58 +0100 Subject: [PATCH 2/2] Bump the limit --- src/state/session/logging.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state/session/logging.ts b/src/state/session/logging.ts index b57f1fa0b0..c1871a56d3 100644 --- a/src/state/session/logging.ts +++ b/src/state/session/logging.ts @@ -76,7 +76,7 @@ export function addSessionErrorLog(did: string, event: AtpSessionEvent) { if (!Statsig.initializeCalled() || !Statsig.getStableID()) { return } - const stack = (new Error().stack ?? '').slice(0, MAX_SLICE_LENGTH) + const stack = (new Error().stack ?? '').slice(0, 1800) Statsig.logEvent('session:error', null, { did, event,