Send inferrable interactions to third-party feeds (#9094)
This commit is contained in:
@@ -28,9 +28,21 @@ import {useAgent} from './session'
|
|||||||
|
|
||||||
export const FEEDBACK_FEEDS = [...PROD_FEEDS, ...STAGING_FEEDS]
|
export const FEEDBACK_FEEDS = [...PROD_FEEDS, ...STAGING_FEEDS]
|
||||||
|
|
||||||
export const DIRECT_FEEDBACK_INTERACTIONS = new Set<
|
export const THIRD_PARTY_ALLOWED_INTERACTIONS = new Set<
|
||||||
AppBskyFeedDefs.Interaction['event']
|
AppBskyFeedDefs.Interaction['event']
|
||||||
>(['app.bsky.feed.defs#requestLess', 'app.bsky.feed.defs#requestMore'])
|
>([
|
||||||
|
// These are explicit actions and are therefore fine to send.
|
||||||
|
'app.bsky.feed.defs#requestLess',
|
||||||
|
'app.bsky.feed.defs#requestMore',
|
||||||
|
// These can be inferred from the firehose and are therefore fine to send.
|
||||||
|
'app.bsky.feed.defs#interactionLike',
|
||||||
|
'app.bsky.feed.defs#interactionQuote',
|
||||||
|
'app.bsky.feed.defs#interactionReply',
|
||||||
|
'app.bsky.feed.defs#interactionRepost',
|
||||||
|
// This can be inferred from pagination requests for everything except the very last page
|
||||||
|
// so it is fine to send. It is crucial for third party algorithmic feeds to receive these.
|
||||||
|
'app.bsky.feed.defs#interactionSeen',
|
||||||
|
])
|
||||||
|
|
||||||
const logger = Logger.create(Logger.Context.FeedFeedback)
|
const logger = Logger.create(Logger.Context.FeedFeedback)
|
||||||
|
|
||||||
@@ -228,7 +240,7 @@ function isInteractionAllowed(
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
const isDiscover = isDiscoverFeed(feed.feedDescriptor)
|
const isDiscover = isDiscoverFeed(feed.feedDescriptor)
|
||||||
return isDiscover ? true : DIRECT_FEEDBACK_INTERACTIONS.has(interaction)
|
return isDiscover ? true : THIRD_PARTY_ALLOWED_INTERACTIONS.has(interaction)
|
||||||
}
|
}
|
||||||
|
|
||||||
function toString(interaction: AppBskyFeedDefs.Interaction): string {
|
function toString(interaction: AppBskyFeedDefs.Interaction): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user