diff --git a/.github/scripts/run-nightly-e2e.sh b/.github/scripts/run-nightly-e2e.sh index 2d97c63c98..e2c9942884 100755 --- a/.github/scripts/run-nightly-e2e.sh +++ b/.github/scripts/run-nightly-e2e.sh @@ -152,7 +152,6 @@ echo "Metro bundle pre-warmed for $bundle_platform" if [[ "$platform" == "android" ]]; then phase "Configuring Android localhost routing" adb -s "$device_id" reverse tcp:3000 tcp:3000 - adb -s "$device_id" reverse tcp:1986 tcp:1986 adb -s "$device_id" reverse tcp:8081 tcp:8081 fi diff --git a/dev-env/mock-server.ts b/dev-env/mock-server.ts index 4fd172221a..12f5bb7edd 100644 --- a/dev-env/mock-server.ts +++ b/dev-env/mock-server.ts @@ -7,23 +7,8 @@ let server: TestPDS // eslint-disable-next-line @typescript-eslint/no-misused-promises createHTTPServer(async (req, res) => { const url = parse(req.url || '/', true) - if (req.method === 'GET') { - if (!server) { - return res.writeHead(503).end() - } - return res - .writeHead(200, { - 'content-type': 'application/json', - }) - .end( - JSON.stringify({ - pdsUrl: server.pdsUrl, - appviewDid: server.appviewDid, - }), - ) - } if (req.method !== 'POST') { - return res.writeHead(405).end() + return res.writeHead(200).end() } try { console.log('Closing old server') diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 80d8639ff2..c4d5657099 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -233,7 +233,7 @@ export const PUBLIC_APPVIEW_DID = 'did:web:api.bsky.app' export const PUBLIC_STAGING_APPVIEW_DID = 'did:web:api.staging.bsky.dev' export const DEV_ENV_APPVIEW = `http://localhost:2584` // always the same -export const DEV_ENV_APPVIEW_DID = `did:plc:dw4kbjf5mn7nhenabiqpkyh3` // always the same +export const DEV_ENV_APPVIEW_DID = `did:plc:bw7ad3erl7btq6qwf66yqiov` // always the same // temp hack for e2e - esb export const BLUESKY_PROXY_HEADER = { diff --git a/src/view/com/testing/TestCtrls.e2e.tsx b/src/view/com/testing/TestCtrls.e2e.tsx index 490cb0478b..f6010921ab 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} from 'react-native' import {useQueryClient} from '@tanstack/react-query' -import {BLUESKY_PROXY_HEADER} from '#/lib/constants' +import {BLUESKY_PROXY_HEADER, DEV_ENV_APPVIEW_DID} from '#/lib/constants' import {useAgent, useSessionApi} from '#/state/session' import {useLoggedOutViewControls} from '#/state/shell/logged-out' import {useOnboardingDispatch} from '#/state/shell/onboarding' @@ -61,13 +61,8 @@ export function TestCtrls() { ) setShowLoggedOut(false) } - const configureProxy = async () => { - const res = await fetch('http://localhost:1986') - if (!res.ok) { - throw new Error(`Failed to load the E2E proxy DID: ${res.status}`) - } - const {appviewDid} = (await res.json()) as {appviewDid: string} - const header = `${appviewDid}#bsky_appview` + const configureProxy = () => { + const header = `${DEV_ENV_APPVIEW_DID}#bsky_appview` BLUESKY_PROXY_HEADER.set(header) agent.configureProxy(header as any) hasConfiguredProxy = true @@ -77,7 +72,7 @@ export function TestCtrls() { void configureProxy()} + onPress={configureProxy} accessibilityRole="button" style={BTN} />