Add logging of selected feed preference when displaying the following feed (#4789)
parent
1b02f81cb8
commit
b3092413dd
|
@ -211,6 +211,12 @@ export type LogEvents = {
|
|||
'feed:interstitial:profileCard:press': {}
|
||||
'feed:interstitial:feedCard: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'}
|
||||
|
|
|
@ -9,7 +9,7 @@ import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
|||
import {logEvent, LogEvents} from '#/lib/statsig/statsig'
|
||||
import {emitSoftReset} from '#/state/events'
|
||||
import {SavedFeedSourceInfo, usePinnedFeedsInfos} from '#/state/queries/feed'
|
||||
import {FeedParams} from '#/state/queries/post-feed'
|
||||
import {FeedDescriptor, 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,6 +108,30 @@ 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()
|
||||
|
@ -136,6 +160,7 @@ function HomeScreenReady({
|
|||
feedUrl: selectedFeed,
|
||||
reason: 'focus',
|
||||
})
|
||||
debugLogFollowingPrefs(selectedFeed)
|
||||
}
|
||||
}),
|
||||
)
|
||||
|
@ -182,8 +207,9 @@ function HomeScreenReady({
|
|||
feedUrl: feed,
|
||||
reason,
|
||||
})
|
||||
debugLogFollowingPrefs(feed)
|
||||
},
|
||||
[allFeeds],
|
||||
[allFeeds, debugLogFollowingPrefs],
|
||||
)
|
||||
|
||||
const onPressSelected = React.useCallback(() => {
|
||||
|
|
Loading…
Reference in New Issue