ai/at
1
0

fix social-app patch

This commit is contained in:
2026-03-01 16:36:29 +09:00
parent f130c8d731
commit 7518cd7d06
3 changed files with 73 additions and 0 deletions

View File

@@ -1,5 +1,14 @@
--- a/src/env/common.ts
+++ b/src/env/common.ts
@@ -88,7 +88,7 @@
* Metrics API host
*/
export const METRICS_API_HOST: string =
- process.env.EXPO_PUBLIC_METRICS_API_HOST || 'https://events.bsky.app'
+ process.env.EXPO_PUBLIC_METRICS_API_HOST || ''
/**
* Growthbook API host
@@ -128,9 +128,7 @@
*/
export const GEOLOCATION_DEV_URL = process.env.GEOLOCATION_DEV_URL
@@ -22,3 +31,11 @@
/**
* URLs for the app-config web worker. Can be a
@@ -148,6 +144,4 @@
*/
export const APP_CONFIG_DEV_URL = process.env.APP_CONFIG_DEV_URL
export const APP_CONFIG_PROD_URL = `https://app-config.workers.bsky.app`
-export const APP_CONFIG_URL = IS_DEV
- ? (APP_CONFIG_DEV_URL ?? APP_CONFIG_PROD_URL)
- : APP_CONFIG_PROD_URL
+export const APP_CONFIG_URL = null

View File

@@ -0,0 +1,55 @@
diff --git a/src/features/liveEvents/context.tsx b/src/features/liveEvents/context.tsx
index 3de2534a8..e11955f57 100644
--- a/src/features/liveEvents/context.tsx
+++ b/src/features/liveEvents/context.tsx
@@ -24,6 +24,7 @@ export const DEFAULT_LIVE_EVENTS = {
async function fetchLiveEvents(): Promise<LiveEventsWorkerResponse | null> {
try {
+ if (!LIVE_EVENTS_URL) return null
const res = await fetch(`${LIVE_EVENTS_URL}/config`)
if (!res.ok) return null
const data = await res.json()
diff --git a/src/geolocation/const.ts b/src/geolocation/const.ts
index 653e829ba..4992cc870 100644
--- a/src/geolocation/const.ts
+++ b/src/geolocation/const.ts
@@ -1,7 +1,9 @@
import {GEOLOCATION_URL} from '#/env'
import {type Geolocation} from '#/geolocation/types'
-export const GEOLOCATION_SERVICE_URL = `${GEOLOCATION_URL}/geolocation`
+export const GEOLOCATION_SERVICE_URL = GEOLOCATION_URL
+ ? `${GEOLOCATION_URL}/geolocation`
+ : null
/**
* Default geolocation config.
diff --git a/src/geolocation/service.ts b/src/geolocation/service.ts
index 2d9285b67..c7c3d02c0 100644
--- a/src/geolocation/service.ts
+++ b/src/geolocation/service.ts
@@ -26,9 +26,10 @@ const onGeolocationServiceResponseUpdate = (
}
async function fetchGeolocationServiceData(
- url: string,
+ url: string | null,
): Promise<Geolocation | undefined> {
if (debug.enabled) return debug.resolve(debug.geolocation)
+ if (!url) throw new Error('geolocation service disabled')
const res = await fetch(url)
if (!res.ok) {
throw new Error(`fetchGeolocationServiceData failed ${res.status}`)
diff --git a/src/state/appConfig.tsx b/src/state/appConfig.tsx
index 67b0e553e..9eacf7ead 100644
--- a/src/state/appConfig.tsx
+++ b/src/state/appConfig.tsx
@@ -30,6 +30,7 @@ let fetchAppConfigPromise: Promise<AppConfigResponse> | undefined
async function fetchAppConfig(): Promise<AppConfigResponse | null> {
try {
+ if (!APP_CONFIG_URL) return null
if (!fetchAppConfigPromise) {
fetchAppConfigPromise = (async () => {
const r = await fetch(`${APP_CONFIG_URL}/config`)

View File

@@ -53,6 +53,7 @@ PATCH_FILES_IOS=(
"043-social-app-ios-rightnav-links.patch"
"044-social-app-ios-splash-video.patch"
"045-social-app-ios-composer-cancel.patch"
"046-social-app-ios-null-url-guards.patch"
)
function ios-env() {