about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-09-05 17:27:18 +0300
committerGitHub <noreply@github.com>2025-09-05 09:27:18 -0500
commit457cd3d0fb4074401eb4df12a5d27fd7cc1387cc (patch)
treee9aea9bd47477cdad518c44d9fac2e4c19b0adf3 /src
parentbc827dc97f6a092b19af5cfda1008cbd9d263a11 (diff)
downloadvoidsky-457cd3d0fb4074401eb4df12a5d27fd7cc1387cc.tar.zst
E2E fixes (#8980)
* update dev-env

* hide nux after onboarding

* use getter/setter for proxy header
Diffstat (limited to 'src')
-rw-r--r--src/lib/constants.ts15
-rw-r--r--src/state/session/agent.ts8
-rw-r--r--src/view/com/testing/TestCtrls.e2e.tsx4
3 files changed, 14 insertions, 13 deletions
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index 5871821f4..616092f15 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -214,13 +214,14 @@ export const PUBLIC_STAGING_APPVIEW_DID = 'did:web:api.staging.bsky.dev'
 export const DEV_ENV_APPVIEW = `http://localhost:2584` // always the same
 
 // temp hack for e2e - esb
-export let BLUESKY_PROXY_HEADER: ProxyHeaderValue = `${BLUESKY_PROXY_DID}#bsky_appview`
-export function setBlueskyProxyHeader(header: ProxyHeaderValue) {
-  BLUESKY_PROXY_HEADER = header
-}
-
-export const BLUESKY_SERVICE_HEADERS = {
-  'atproto-proxy': BLUESKY_PROXY_HEADER,
+export const BLUESKY_PROXY_HEADER = {
+  value: `${BLUESKY_PROXY_DID}#bsky_appview`,
+  get() {
+    return this.value as ProxyHeaderValue
+  },
+  set(value: string) {
+    this.value = value
+  },
 }
 
 export const DM_SERVICE_HEADERS = {
diff --git a/src/state/session/agent.ts b/src/state/session/agent.ts
index d063a09a2..4f14173e2 100644
--- a/src/state/session/agent.ts
+++ b/src/state/session/agent.ts
@@ -39,7 +39,7 @@ export function createPublicAgent() {
   configureModerationForGuest() // Side effect but only relevant for tests
 
   const agent = new BskyAppAgent({service: PUBLIC_BSKY_SERVICE})
-  agent.configureProxy(BLUESKY_PROXY_HEADER)
+  agent.configureProxy(BLUESKY_PROXY_HEADER.get())
   return agent
 }
 
@@ -77,7 +77,7 @@ export async function createAgentAndResume(
     }
   }
 
-  agent.configureProxy(BLUESKY_PROXY_HEADER)
+  agent.configureProxy(BLUESKY_PROXY_HEADER.get())
 
   return agent.prepare(gates, moderation, onSessionChange)
 }
@@ -112,7 +112,7 @@ export async function createAgentAndLogin(
   const gates = tryFetchGates(account.did, 'prefer-fresh-gates')
   const moderation = configureModerationForAccount(agent, account)
 
-  agent.configureProxy(BLUESKY_PROXY_HEADER)
+  agent.configureProxy(BLUESKY_PROXY_HEADER.get())
 
   return agent.prepare(gates, moderation, onSessionChange)
 }
@@ -201,7 +201,7 @@ export async function createAgentAndCreateAccount(
     logger.error(e, {message: `session: failed snoozeEmailConfirmationPrompt`})
   }
 
-  agent.configureProxy(BLUESKY_PROXY_HEADER)
+  agent.configureProxy(BLUESKY_PROXY_HEADER.get())
 
   return agent.prepare(gates, moderation, onSessionChange)
 }
diff --git a/src/view/com/testing/TestCtrls.e2e.tsx b/src/view/com/testing/TestCtrls.e2e.tsx
index 8e39e28c0..3fc1032ed 100644
--- a/src/view/com/testing/TestCtrls.e2e.tsx
+++ b/src/view/com/testing/TestCtrls.e2e.tsx
@@ -2,7 +2,7 @@ import {useState} from 'react'
 import {LogBox, Pressable, View, TextInput} from 'react-native'
 import {useQueryClient} from '@tanstack/react-query'
 
-import {setBlueskyProxyHeader} from '#/lib/constants'
+import {BLUESKY_PROXY_HEADER} from '#/lib/constants'
 import {useModalControls} from '#/state/modals'
 import {useSessionApi, useAgent} from '#/state/session'
 import {useLoggedOutViewControls} from '#/state/shell/logged-out'
@@ -56,7 +56,7 @@ export function TestCtrls() {
         onChangeText={val => setProxyHeader(val as any)}
         onSubmitEditing={() => {
           const header = `${proxyHeader}#bsky_appview`
-          setBlueskyProxyHeader(header as any)
+          BLUESKY_PROXY_HEADER.set(header)
           agent.configureProxy(header as any)
         }}
         style={BTN}