Fix missing recId values for suggested user events (#10291)

Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
DS Boyce
2026-04-21 13:59:13 -07:00
committed by GitHub
parent bfdaab0a14
commit 07344f70fc
10 changed files with 38 additions and 4 deletions
+2
View File
@@ -487,6 +487,7 @@ export type Events = {
| 'SeeMoreSuggestedUsers' | 'SeeMoreSuggestedUsers'
| 'ProgressGuide' | 'ProgressGuide'
location: 'Card' | 'Profile' | 'FollowAll' location: 'Card' | 'Profile' | 'FollowAll'
recSource?: 'Search'
recId?: number | string recId?: number | string
position: number position: number
suggestedDid: string suggestedDid: string
@@ -514,6 +515,7 @@ export type Events = {
| 'Onboarding' | 'Onboarding'
| 'SeeMoreSuggestedUsers' | 'SeeMoreSuggestedUsers'
| 'ProgressGuide' | 'ProgressGuide'
recSource?: 'Search'
recId?: number | string recId?: number | string
position: number position: number
suggestedDid: string suggestedDid: string
+1
View File
@@ -167,6 +167,7 @@ export function SuggestedFollowsHome() {
return ( return (
<ProfileGrid <ProfileGrid
recId={data?.recId}
isSuggestionsLoading={isLoading} isSuggestionsLoading={isLoading}
profiles={filteredProfiles} profiles={filteredProfiles}
totalProfileCount={allProfiles.length} totalProfileCount={allProfiles.length}
@@ -249,6 +249,7 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
moderationOpts={moderationOpts!} moderationOpts={moderationOpts!}
noBorder={index === 0} noBorder={index === 0}
position={index} position={index}
recSource={hasSearchText ? 'Search' : undefined}
recId={recIdForLogging} recId={recIdForLogging}
isGuide={isGuide} isGuide={isGuide}
/> />
@@ -264,7 +265,7 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
return null return null
} }
}, },
[moderationOpts, recIdForLogging, isGuide], [moderationOpts, hasSearchText, recIdForLogging, isGuide],
) )
// Track seen profiles // Track seen profiles
@@ -286,6 +287,7 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
) )
ax.metric('suggestedUser:seen', { ax.metric('suggestedUser:seen', {
logContext: isGuide ? 'ProgressGuide' : 'SeeMoreSuggestedUsers', logContext: isGuide ? 'ProgressGuide' : 'SeeMoreSuggestedUsers',
recSource: hasSearchText ? 'Search' : undefined,
recId: recIdForLogging, recId: recIdForLogging,
position: position !== -1 ? position : 0, position: position !== -1 ? position : 0,
suggestedDid: item.profile.did, suggestedDid: item.profile.did,
@@ -548,6 +550,7 @@ let FollowProfileCard = ({
moderationOpts, moderationOpts,
noBorder, noBorder,
position, position,
recSource,
recId, recId,
isGuide, isGuide,
}: { }: {
@@ -555,6 +558,7 @@ let FollowProfileCard = ({
moderationOpts: ModerationOpts moderationOpts: ModerationOpts
noBorder?: boolean noBorder?: boolean
position: number position: number
recSource?: 'Search'
recId?: string recId?: string
isGuide: boolean isGuide: boolean
}): React.ReactNode => { }): React.ReactNode => {
@@ -564,6 +568,7 @@ let FollowProfileCard = ({
moderationOpts={moderationOpts} moderationOpts={moderationOpts}
noBorder={noBorder} noBorder={noBorder}
position={position} position={position}
recSource={recSource}
recId={recId} recId={recId}
isGuide={isGuide} isGuide={isGuide}
/> />
@@ -577,6 +582,7 @@ function FollowProfileCardInner({
onFollow, onFollow,
noBorder, noBorder,
position, position,
recSource,
recId, recId,
isGuide, isGuide,
}: { }: {
@@ -585,6 +591,7 @@ function FollowProfileCardInner({
onFollow?: () => void onFollow?: () => void
noBorder?: boolean noBorder?: boolean
position: number position: number
recSource?: 'Search'
recId?: string recId?: string
isGuide: boolean isGuide: boolean
}) { }) {
@@ -625,6 +632,7 @@ function FollowProfileCardInner({
? 'ProgressGuide' ? 'ProgressGuide'
: 'SeeMoreSuggestedUsers', : 'SeeMoreSuggestedUsers',
location: 'Card', location: 'Card',
recSource,
recId, recId,
position, position,
suggestedDid: profile.did, suggestedDid: profile.did,
@@ -105,6 +105,7 @@ export function StepSuggestedAccounts() {
ax.metric('suggestedUser:follow', { ax.metric('suggestedUser:follow', {
logContext: 'Onboarding', logContext: 'Onboarding',
location: 'FollowAll', location: 'FollowAll',
recSource: !useFullExperience ? 'Search' : undefined,
recId: suggestedUsers?.recId, recId: suggestedUsers?.recId,
position: i, position: i,
suggestedDid: did, suggestedDid: did,
@@ -155,6 +156,7 @@ export function StepSuggestedAccounts() {
seenProfilesRef.current.add(did) seenProfilesRef.current.add(did)
ax.metric('suggestedUser:seen', { ax.metric('suggestedUser:seen', {
logContext: 'Onboarding', logContext: 'Onboarding',
recSource: !useFullExperience ? 'Search' : undefined,
recId: suggestedUsers?.recId, recId: suggestedUsers?.recId,
position, position,
suggestedDid: did, suggestedDid: did,
@@ -162,7 +164,7 @@ export function StepSuggestedAccounts() {
}) })
} }
}, },
[ax, selectedInterest, suggestedUsers?.recId], [ax, selectedInterest, suggestedUsers?.recId, useFullExperience],
) )
useEffect(() => { useEffect(() => {
@@ -248,6 +250,7 @@ export function StepSuggestedAccounts() {
position={index} position={index}
category={selectedInterest} category={selectedInterest}
onSeen={onProfileSeen} onSeen={onProfileSeen}
recSource={!useFullExperience ? 'Search' : undefined}
recId={suggestedUsers.recId} recId={suggestedUsers.recId}
/> />
))} ))}
@@ -358,6 +361,7 @@ function SuggestedProfileCard({
position, position,
category, category,
onSeen, onSeen,
recSource,
recId, recId,
}: { }: {
profile: bsky.profile.AnyProfileView profile: bsky.profile.AnyProfileView
@@ -365,6 +369,7 @@ function SuggestedProfileCard({
position: number position: number
category: string | null category: string | null
onSeen: (did: string, position: number) => void onSeen: (did: string, position: number) => void
recSource?: 'Search'
recId?: number | string recId?: number | string
}) { }) {
const t = useTheme() const t = useTheme()
@@ -432,6 +437,7 @@ function SuggestedProfileCard({
ax.metric('suggestedUser:follow', { ax.metric('suggestedUser:follow', {
logContext: 'Onboarding', logContext: 'Onboarding',
location: 'Card', location: 'Card',
recSource,
recId, recId,
position, position,
suggestedDid: profile.did, suggestedDid: profile.did,
+2 -1
View File
@@ -162,7 +162,7 @@ type ExploreScreenItems =
type: 'profile' type: 'profile'
key: string key: string
profile: AppBskyActorDefs.ProfileView profile: AppBskyActorDefs.ProfileView
recId?: number recId?: string
} }
| { | {
type: 'profileEmpty' type: 'profileEmpty'
@@ -406,6 +406,7 @@ export function Explore({
type: 'profile', type: 'profile',
key: actor.did, key: actor.did,
profile: actor, profile: actor,
recId: suggestedUsers.recId,
}) })
} }
} }
@@ -105,7 +105,7 @@ let SuggestedProfileCard = ({
}: { }: {
profile: bsky.profile.AnyProfileView profile: bsky.profile.AnyProfileView
moderationOpts: ModerationOpts moderationOpts: ModerationOpts
recId?: number recId?: string
position: number position: number
}): React.ReactNode => { }): React.ReactNode => {
const t = useTheme() const t = useTheme()
@@ -5,6 +5,7 @@ import {
import {type QueryClient, useQuery} from '@tanstack/react-query' import {type QueryClient, useQuery} from '@tanstack/react-query'
import {createBskyTopicsHeader} from '#/lib/api/feed/utils' import {createBskyTopicsHeader} from '#/lib/api/feed/utils'
import {logger} from '#/logger'
import {getContentLanguages} from '#/state/preferences/languages' import {getContentLanguages} from '#/state/preferences/languages'
import {STALE} from '#/state/queries' import {STALE} from '#/state/queries'
import {usePreferencesQuery} from '#/state/queries/preferences' 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} return {...data, recId: data.recIdStr}
}, },
}) })
@@ -8,6 +8,7 @@ import {
aggregateUserInterests, aggregateUserInterests,
createBskyTopicsHeader, createBskyTopicsHeader,
} from '#/lib/api/feed/utils' } from '#/lib/api/feed/utils'
import {logger} from '#/logger'
import {getContentLanguages} from '#/state/preferences/languages' import {getContentLanguages} from '#/state/preferences/languages'
import {STALE} from '#/state/queries' import {STALE} from '#/state/queries'
import {usePreferencesQuery} from '#/state/queries/preferences' 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} return {...data, recId: data.recIdStr}
}, },
}) })
@@ -8,6 +8,7 @@ import {
aggregateUserInterests, aggregateUserInterests,
createBskyTopicsHeader, createBskyTopicsHeader,
} from '#/lib/api/feed/utils' } from '#/lib/api/feed/utils'
import {logger} from '#/logger'
import {getContentLanguages} from '#/state/preferences/languages' import {getContentLanguages} from '#/state/preferences/languages'
import {STALE} from '#/state/queries' import {STALE} from '#/state/queries'
import {usePreferencesQuery} from '#/state/queries/preferences' 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} return {...data, recId: data.recIdStr}
}, },
}) })
@@ -8,6 +8,7 @@ import {
aggregateUserInterests, aggregateUserInterests,
createBskyTopicsHeader, createBskyTopicsHeader,
} from '#/lib/api/feed/utils' } from '#/lib/api/feed/utils'
import {logger} from '#/logger'
import {getContentLanguages} from '#/state/preferences/languages' import {getContentLanguages} from '#/state/preferences/languages'
import {STALE} from '#/state/queries' import {STALE} from '#/state/queries'
import {usePreferencesQuery} from '#/state/queries/preferences' 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} return {...data, recId: data.recIdStr}
}, },
}) })