Skip to content

Commit

Permalink
Remove logging of following prefs (#5021)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Aug 29, 2024
1 parent faf66f3 commit 9ebc278
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 34 deletions.
6 changes: 0 additions & 6 deletions src/lib/statsig/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,6 @@ export type LogEvents = {

'profile:header:suggestedFollowsCard:press': {}

'debug:followingPrefs': {
followingShowRepliesFromPref: 'all' | 'following' | 'off'
followingRepliesMinLikePref: number
}
'debug:followingDisplayed': {}

'test:all:always': {}
'test:all:sometimes': {}
'test:all:boosted_by_gate1': {reason: 'base' | 'gate1'}
Expand Down
30 changes: 2 additions & 28 deletions src/view/screens/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {logEvent, LogEvents} from '#/lib/statsig/statsig'
import {useGate} from '#/lib/statsig/statsig'
import {emitSoftReset} from '#/state/events'
import {SavedFeedSourceInfo, usePinnedFeedsInfos} from '#/state/queries/feed'
import {FeedDescriptor, FeedParams} from '#/state/queries/post-feed'
import {FeedParams} from '#/state/queries/post-feed'
import {usePreferencesQuery} from '#/state/queries/preferences'
import {UsePreferencesQueryResponse} from '#/state/queries/preferences/types'
import {useSession} from '#/state/session'
Expand Down Expand Up @@ -108,30 +108,6 @@ function HomeScreenReady({
}
}, [selectedIndex])

// Temporary, remove when finished debugging
const debugHasLoggedFollowingPrefs = React.useRef(false)
const debugLogFollowingPrefs = React.useCallback(
(feed: FeedDescriptor) => {
if (debugHasLoggedFollowingPrefs.current) return
if (feed !== 'following') return
logEvent('debug:followingPrefs', {
followingShowRepliesFromPref: preferences.feedViewPrefs.hideReplies
? 'off'
: preferences.feedViewPrefs.hideRepliesByUnfollowed
? 'following'
: 'all',
followingRepliesMinLikePref:
preferences.feedViewPrefs.hideRepliesByLikeCount,
})
debugHasLoggedFollowingPrefs.current = true
},
[
preferences.feedViewPrefs.hideReplies,
preferences.feedViewPrefs.hideRepliesByLikeCount,
preferences.feedViewPrefs.hideRepliesByUnfollowed,
],
)

const {hasSession} = useSession()
const setMinimalShellMode = useSetMinimalShellMode()
const setDrawerSwipeDisabled = useSetDrawerSwipeDisabled()
Expand All @@ -154,7 +130,6 @@ function HomeScreenReady({
feedUrl: selectedFeed,
reason: 'focus',
})
debugLogFollowingPrefs(selectedFeed)
}
}),
)
Expand Down Expand Up @@ -205,9 +180,8 @@ function HomeScreenReady({
feedUrl: feed,
reason,
})
debugLogFollowingPrefs(feed)
},
[allFeeds, debugLogFollowingPrefs],
[allFeeds],
)

const onPressSelected = React.useCallback(() => {
Expand Down

0 comments on commit 9ebc278

Please sign in to comment.