Fix missing recId values for suggested user events (#10291)
Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -487,6 +487,7 @@ export type Events = {
|
||||
| 'SeeMoreSuggestedUsers'
|
||||
| 'ProgressGuide'
|
||||
location: 'Card' | 'Profile' | 'FollowAll'
|
||||
recSource?: 'Search'
|
||||
recId?: number | string
|
||||
position: number
|
||||
suggestedDid: string
|
||||
@@ -514,6 +515,7 @@ export type Events = {
|
||||
| 'Onboarding'
|
||||
| 'SeeMoreSuggestedUsers'
|
||||
| 'ProgressGuide'
|
||||
recSource?: 'Search'
|
||||
recId?: number | string
|
||||
position: number
|
||||
suggestedDid: string
|
||||
|
||||
@@ -167,6 +167,7 @@ export function SuggestedFollowsHome() {
|
||||
|
||||
return (
|
||||
<ProfileGrid
|
||||
recId={data?.recId}
|
||||
isSuggestionsLoading={isLoading}
|
||||
profiles={filteredProfiles}
|
||||
totalProfileCount={allProfiles.length}
|
||||
|
||||
@@ -249,6 +249,7 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
|
||||
moderationOpts={moderationOpts!}
|
||||
noBorder={index === 0}
|
||||
position={index}
|
||||
recSource={hasSearchText ? 'Search' : undefined}
|
||||
recId={recIdForLogging}
|
||||
isGuide={isGuide}
|
||||
/>
|
||||
@@ -264,7 +265,7 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
|
||||
return null
|
||||
}
|
||||
},
|
||||
[moderationOpts, recIdForLogging, isGuide],
|
||||
[moderationOpts, hasSearchText, recIdForLogging, isGuide],
|
||||
)
|
||||
|
||||
// Track seen profiles
|
||||
@@ -286,6 +287,7 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
|
||||
)
|
||||
ax.metric('suggestedUser:seen', {
|
||||
logContext: isGuide ? 'ProgressGuide' : 'SeeMoreSuggestedUsers',
|
||||
recSource: hasSearchText ? 'Search' : undefined,
|
||||
recId: recIdForLogging,
|
||||
position: position !== -1 ? position : 0,
|
||||
suggestedDid: item.profile.did,
|
||||
@@ -548,6 +550,7 @@ let FollowProfileCard = ({
|
||||
moderationOpts,
|
||||
noBorder,
|
||||
position,
|
||||
recSource,
|
||||
recId,
|
||||
isGuide,
|
||||
}: {
|
||||
@@ -555,6 +558,7 @@ let FollowProfileCard = ({
|
||||
moderationOpts: ModerationOpts
|
||||
noBorder?: boolean
|
||||
position: number
|
||||
recSource?: 'Search'
|
||||
recId?: string
|
||||
isGuide: boolean
|
||||
}): React.ReactNode => {
|
||||
@@ -564,6 +568,7 @@ let FollowProfileCard = ({
|
||||
moderationOpts={moderationOpts}
|
||||
noBorder={noBorder}
|
||||
position={position}
|
||||
recSource={recSource}
|
||||
recId={recId}
|
||||
isGuide={isGuide}
|
||||
/>
|
||||
@@ -577,6 +582,7 @@ function FollowProfileCardInner({
|
||||
onFollow,
|
||||
noBorder,
|
||||
position,
|
||||
recSource,
|
||||
recId,
|
||||
isGuide,
|
||||
}: {
|
||||
@@ -585,6 +591,7 @@ function FollowProfileCardInner({
|
||||
onFollow?: () => void
|
||||
noBorder?: boolean
|
||||
position: number
|
||||
recSource?: 'Search'
|
||||
recId?: string
|
||||
isGuide: boolean
|
||||
}) {
|
||||
@@ -625,6 +632,7 @@ function FollowProfileCardInner({
|
||||
? 'ProgressGuide'
|
||||
: 'SeeMoreSuggestedUsers',
|
||||
location: 'Card',
|
||||
recSource,
|
||||
recId,
|
||||
position,
|
||||
suggestedDid: profile.did,
|
||||
|
||||
@@ -105,6 +105,7 @@ export function StepSuggestedAccounts() {
|
||||
ax.metric('suggestedUser:follow', {
|
||||
logContext: 'Onboarding',
|
||||
location: 'FollowAll',
|
||||
recSource: !useFullExperience ? 'Search' : undefined,
|
||||
recId: suggestedUsers?.recId,
|
||||
position: i,
|
||||
suggestedDid: did,
|
||||
@@ -155,6 +156,7 @@ export function StepSuggestedAccounts() {
|
||||
seenProfilesRef.current.add(did)
|
||||
ax.metric('suggestedUser:seen', {
|
||||
logContext: 'Onboarding',
|
||||
recSource: !useFullExperience ? 'Search' : undefined,
|
||||
recId: suggestedUsers?.recId,
|
||||
position,
|
||||
suggestedDid: did,
|
||||
@@ -162,7 +164,7 @@ export function StepSuggestedAccounts() {
|
||||
})
|
||||
}
|
||||
},
|
||||
[ax, selectedInterest, suggestedUsers?.recId],
|
||||
[ax, selectedInterest, suggestedUsers?.recId, useFullExperience],
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -248,6 +250,7 @@ export function StepSuggestedAccounts() {
|
||||
position={index}
|
||||
category={selectedInterest}
|
||||
onSeen={onProfileSeen}
|
||||
recSource={!useFullExperience ? 'Search' : undefined}
|
||||
recId={suggestedUsers.recId}
|
||||
/>
|
||||
))}
|
||||
@@ -358,6 +361,7 @@ function SuggestedProfileCard({
|
||||
position,
|
||||
category,
|
||||
onSeen,
|
||||
recSource,
|
||||
recId,
|
||||
}: {
|
||||
profile: bsky.profile.AnyProfileView
|
||||
@@ -365,6 +369,7 @@ function SuggestedProfileCard({
|
||||
position: number
|
||||
category: string | null
|
||||
onSeen: (did: string, position: number) => void
|
||||
recSource?: 'Search'
|
||||
recId?: number | string
|
||||
}) {
|
||||
const t = useTheme()
|
||||
@@ -432,6 +437,7 @@ function SuggestedProfileCard({
|
||||
ax.metric('suggestedUser:follow', {
|
||||
logContext: 'Onboarding',
|
||||
location: 'Card',
|
||||
recSource,
|
||||
recId,
|
||||
position,
|
||||
suggestedDid: profile.did,
|
||||
|
||||
@@ -162,7 +162,7 @@ type ExploreScreenItems =
|
||||
type: 'profile'
|
||||
key: string
|
||||
profile: AppBskyActorDefs.ProfileView
|
||||
recId?: number
|
||||
recId?: string
|
||||
}
|
||||
| {
|
||||
type: 'profileEmpty'
|
||||
@@ -406,6 +406,7 @@ export function Explore({
|
||||
type: 'profile',
|
||||
key: actor.did,
|
||||
profile: actor,
|
||||
recId: suggestedUsers.recId,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ let SuggestedProfileCard = ({
|
||||
}: {
|
||||
profile: bsky.profile.AnyProfileView
|
||||
moderationOpts: ModerationOpts
|
||||
recId?: number
|
||||
recId?: string
|
||||
position: number
|
||||
}): React.ReactNode => {
|
||||
const t = useTheme()
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
import {type QueryClient, useQuery} from '@tanstack/react-query'
|
||||
|
||||
import {createBskyTopicsHeader} from '#/lib/api/feed/utils'
|
||||
import {logger} from '#/logger'
|
||||
import {getContentLanguages} from '#/state/preferences/languages'
|
||||
import {STALE} from '#/state/queries'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
@@ -54,6 +55,9 @@ export function useGetSuggestedOnboardingUsersQuery(props: QueryProps) {
|
||||
},
|
||||
)
|
||||
|
||||
if (!data.recIdStr) {
|
||||
logger.debug('getSuggestedOnboardingUsers response missing recIdStr')
|
||||
}
|
||||
return {...data, recId: data.recIdStr}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
aggregateUserInterests,
|
||||
createBskyTopicsHeader,
|
||||
} from '#/lib/api/feed/utils'
|
||||
import {logger} from '#/logger'
|
||||
import {getContentLanguages} from '#/state/preferences/languages'
|
||||
import {STALE} from '#/state/queries'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
@@ -46,6 +47,9 @@ export function useGetSuggestedUsersForDiscoverQuery(props: QueryProps = {}) {
|
||||
},
|
||||
},
|
||||
)
|
||||
if (!data.recIdStr) {
|
||||
logger.debug('getSuggestedUsersForDiscover response missing recIdStr')
|
||||
}
|
||||
return {...data, recId: data.recIdStr}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
aggregateUserInterests,
|
||||
createBskyTopicsHeader,
|
||||
} from '#/lib/api/feed/utils'
|
||||
import {logger} from '#/logger'
|
||||
import {getContentLanguages} from '#/state/preferences/languages'
|
||||
import {STALE} from '#/state/queries'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
@@ -48,6 +49,9 @@ export function useGetSuggestedUsersForExploreQuery(props: QueryProps = {}) {
|
||||
},
|
||||
)
|
||||
|
||||
if (!data.recIdStr) {
|
||||
logger.debug('getSuggestedUsersForExplore response missing recIdStr')
|
||||
}
|
||||
return {...data, recId: data.recIdStr}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
aggregateUserInterests,
|
||||
createBskyTopicsHeader,
|
||||
} from '#/lib/api/feed/utils'
|
||||
import {logger} from '#/logger'
|
||||
import {getContentLanguages} from '#/state/preferences/languages'
|
||||
import {STALE} from '#/state/queries'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
@@ -54,6 +55,9 @@ export function useGetSuggestedUsersForSeeMoreQuery(props: QueryProps = {}) {
|
||||
},
|
||||
)
|
||||
|
||||
if (!data.recIdStr) {
|
||||
logger.debug('getSuggestedUsersForSeeMore response missing recIdStr')
|
||||
}
|
||||
return {...data, recId: data.recIdStr}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user