about summary refs log tree commit diff
path: root/src/state/feed-feedback.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-08-13 08:20:39 +0100
committerGitHub <noreply@github.com>2024-08-13 00:20:39 -0700
commit7e11b862e931b5351bd3463d984ab11ee9b46522 (patch)
tree9e75b7c031d01f7bd5ce8dc9c2f09bd61fbb162b /src/state/feed-feedback.tsx
parent1fce7a793d6fc67b58f0fccff327930cc0e062b0 (diff)
downloadvoidsky-7e11b862e931b5351bd3463d984ab11ee9b46522.tar.zst
Remove .withProxy() calls (#4929)
Diffstat (limited to 'src/state/feed-feedback.tsx')
-rw-r--r--src/state/feed-feedback.tsx46
1 files changed, 15 insertions, 31 deletions
diff --git a/src/state/feed-feedback.tsx b/src/state/feed-feedback.tsx
index aab2737e5..29f328a62 100644
--- a/src/state/feed-feedback.tsx
+++ b/src/state/feed-feedback.tsx
@@ -1,11 +1,10 @@
 import React from 'react'
 import {AppState, AppStateStatus} from 'react-native'
-import {AppBskyFeedDefs, BskyAgent} from '@atproto/api'
+import {AppBskyFeedDefs} from '@atproto/api'
 import throttle from 'lodash.throttle'
 
 import {PROD_DEFAULT_FEED} from '#/lib/constants'
 import {logEvent} from '#/lib/statsig/statsig'
-import {useGate} from '#/lib/statsig/statsig'
 import {logger} from '#/logger'
 import {FeedDescriptor, FeedPostSliceItem} from '#/state/queries/post-feed'
 import {getFeedPostSlice} from '#/view/com/posts/Feed'
@@ -25,7 +24,6 @@ const stateContext = React.createContext<StateContext>({
 
 export function useFeedFeedback(feed: FeedDescriptor, hasSession: boolean) {
   const agent = useAgent()
-  const gate = useGate()
   const enabled = isDiscoverFeed(feed) && hasSession
   const queue = React.useRef<Set<string>>(new Set())
   const history = React.useRef<
@@ -49,34 +47,20 @@ export function useFeedFeedback(feed: FeedDescriptor, hasSession: boolean) {
     queue.current.clear()
 
     // Send to the feed
-    if (gate('session_withproxy_fix')) {
-      agent.app.bsky.feed
-        .sendInteractions(
-          {interactions},
-          {
-            encoding: 'application/json',
-            headers: {
-              // TODO when we start sending to other feeds, we need to grab their DID -prf
-              'atproto-proxy': 'did:web:discover.bsky.app#bsky_fg',
-            },
+    agent.app.bsky.feed
+      .sendInteractions(
+        {interactions},
+        {
+          encoding: 'application/json',
+          headers: {
+            // TODO when we start sending to other feeds, we need to grab their DID -prf
+            'atproto-proxy': 'did:web:discover.bsky.app#bsky_fg',
           },
-        )
-        .catch((e: any) => {
-          logger.warn('Failed to send feed interactions', {error: e})
-        })
-    } else {
-      const proxyAgent = agent.withProxy(
-        // @ts-ignore TODO need to update withProxy() to support this key -prf
-        'bsky_fg',
-        // TODO when we start sending to other feeds, we need to grab their DID -prf
-        'did:web:discover.bsky.app',
-      ) as BskyAgent
-      proxyAgent.app.bsky.feed
-        .sendInteractions({interactions})
-        .catch((e: any) => {
-          logger.warn('Failed to send feed interactions', {error: e})
-        })
-    }
+        },
+      )
+      .catch((e: any) => {
+        logger.warn('Failed to send feed interactions', {error: e})
+      })
 
     // Send to Statsig
     if (aggregatedStats.current === null) {
@@ -84,7 +68,7 @@ export function useFeedFeedback(feed: FeedDescriptor, hasSession: boolean) {
     }
     sendOrAggregateInteractionsForStats(aggregatedStats.current, interactions)
     throttledFlushAggregatedStats()
-  }, [agent, gate, throttledFlushAggregatedStats])
+  }, [agent, throttledFlushAggregatedStats])
 
   const sendToFeed = React.useMemo(
     () =>