about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/state/session/agent.ts6
-rw-r--r--src/state/session/logging.ts4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/state/session/agent.ts b/src/state/session/agent.ts
index d31b5588b..4456ab0bf 100644
--- a/src/state/session/agent.ts
+++ b/src/state/session/agent.ts
@@ -12,7 +12,7 @@ import {tryFetchGates} from '#/lib/statsig/statsig'
 import {getAge} from '#/lib/strings/time'
 import {logger} from '#/logger'
 import {snoozeEmailConfirmationPrompt} from '#/state/shell/reminders'
-import {addSessionEventLog} from './logging'
+import {addSessionErrorLog} from './logging'
 import {
   configureModerationForAccount,
   configureModerationForGuest,
@@ -195,7 +195,9 @@ async function prepareAgent(
   const account = agentToSessionAccountOrThrow(agent)
   agent.setPersistSessionHandler(event => {
     onSessionChange(agent, account.did, event)
-    addSessionEventLog(account.did, event)
+    if (event !== 'create' && event !== 'update') {
+      addSessionErrorLog(account.did, event)
+    }
   })
   return {agent, account}
 }
diff --git a/src/state/session/logging.ts b/src/state/session/logging.ts
index ab67785ca..9a703957d 100644
--- a/src/state/session/logging.ts
+++ b/src/state/session/logging.ts
@@ -71,12 +71,12 @@ let nextMessageIndex = 0
 const MAX_SLICE_LENGTH = 1000
 
 // Not gated.
-export function addSessionEventLog(did: string, event: AtpSessionEvent) {
+export function addSessionErrorLog(did: string, event: AtpSessionEvent) {
   try {
     if (!Statsig.initializeCalled() || !Statsig.getStableID()) {
       return
     }
-    Statsig.logEvent('session:event', null, {did, event})
+    Statsig.logEvent('session:error', null, {did, event})
   } catch (e) {
     console.error(e)
   }