Post source handling updates (#8472)

* Add debugs

* Key post-source using URI with handle

* Enhance

* EnHANCE

* ENHANCE

* ENHANCEEEECEE

* ᵉⁿʰᵃⁿᶜᵉ

* enhance
This commit is contained in:
Eric Bailey
2025-06-11 13:22:02 -05:00
committed by GitHub
parent 7341294df6
commit 143d5f3b81
8 changed files with 148 additions and 85 deletions
+7 -1
View File
@@ -12,7 +12,7 @@ import throttle from 'lodash.throttle'
import {FEEDBACK_FEEDS, STAGING_FEEDS} from '#/lib/constants'
import {logEvent} from '#/lib/statsig/statsig'
import {logger} from '#/logger'
import {Logger} from '#/logger'
import {
type FeedDescriptor,
type FeedPostSliceItem,
@@ -20,6 +20,8 @@ import {
import {getItemsForFeedback} from '#/view/com/posts/PostFeed'
import {useAgent} from './session'
const logger = Logger.create(Logger.Context.FeedFeedback)
export type StateContext = {
enabled: boolean
onItemSeen: (item: any) => void
@@ -89,6 +91,7 @@ export function useFeedFeedback(
}
sendOrAggregateInteractionsForStats(aggregatedStats.current, interactions)
throttledFlushAggregatedStats()
logger.debug('flushed')
}, [agent, throttledFlushAggregatedStats, feed])
const sendToFeed = useMemo(
@@ -141,6 +144,9 @@ export function useFeedFeedback(
if (!enabled) {
return
}
logger.debug('sendInteraction', {
...interaction,
})
if (!history.current.has(interaction)) {
history.current.add(interaction)
queue.current.add(toString(interaction))