Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Log session events unconditionally (#4758)

authored by

dan and committed by
GitHub
7a476568 2d0eefeb

+15 -1
+2
src/state/session/agent.ts
··· 12 12 import {getAge} from '#/lib/strings/time' 13 13 import {logger} from '#/logger' 14 14 import {snoozeEmailConfirmationPrompt} from '#/state/shell/reminders' 15 + import {addSessionEventLog} from './logging' 15 16 import { 16 17 configureModerationForAccount, 17 18 configureModerationForGuest, ··· 194 195 const account = agentToSessionAccountOrThrow(agent) 195 196 agent.setPersistSessionHandler(event => { 196 197 onSessionChange(agent, account.did, event) 198 + addSessionEventLog(account.did, event) 197 199 }) 198 200 return {agent, account} 199 201 }
+13 -1
src/state/session/logging.ts
··· 1 - import {AtpSessionData} from '@atproto/api' 1 + import {AtpSessionData, AtpSessionEvent} from '@atproto/api' 2 2 import {sha256} from 'js-sha256' 3 3 import {Statsig} from 'statsig-react-native-expo' 4 4 ··· 69 69 70 70 let nextMessageIndex = 0 71 71 const MAX_SLICE_LENGTH = 1000 72 + 73 + // Not gated. 74 + export function addSessionEventLog(did: string, event: AtpSessionEvent) { 75 + try { 76 + if (!Statsig.initializeCalled() || !Statsig.getStableID()) { 77 + return 78 + } 79 + Statsig.logEvent('session:event', null, {did, event}) 80 + } catch (e) { 81 + console.error(e) 82 + } 83 + } 72 84 73 85 export function addSessionDebugLog(log: Log) { 74 86 try {