Remove logging of following prefs (#5021)

zio/stable
dan 2024-08-29 20:08:48 +01:00 committed by GitHub
parent faf66f3178
commit 9ebc2785e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 34 deletions

View File

@ -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'}

View File

@ -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'
@ -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()
@ -154,7 +130,6 @@ function HomeScreenReady({
feedUrl: selectedFeed,
reason: 'focus',
})
debugLogFollowingPrefs(selectedFeed)
}
}),
)
@ -205,9 +180,8 @@ function HomeScreenReady({
feedUrl: feed,
reason,
})
debugLogFollowingPrefs(feed)
},
[allFeeds, debugLogFollowingPrefs],
[allFeeds],
)
const onPressSelected = React.useCallback(() => {