From 7518cd7d06fc2d1c7919b2e546848f637fad2380 Mon Sep 17 00:00:00 2001 From: syui Date: Sun, 1 Mar 2026 16:36:29 +0900 Subject: [PATCH] fix social-app patch --- ...al-app-ios-disable-external-services.patch | 17 ++++++ .../046-social-app-ios-null-url-guards.patch | 55 +++++++++++++++++++ ios/setup.zsh | 1 + 3 files changed, 73 insertions(+) create mode 100644 ios/patching/046-social-app-ios-null-url-guards.patch diff --git a/ios/patching/024-social-app-ios-disable-external-services.patch b/ios/patching/024-social-app-ios-disable-external-services.patch index 47c7739..8d8b846 100644 --- a/ios/patching/024-social-app-ios-disable-external-services.patch +++ b/ios/patching/024-social-app-ios-disable-external-services.patch @@ -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 diff --git a/ios/patching/046-social-app-ios-null-url-guards.patch b/ios/patching/046-social-app-ios-null-url-guards.patch new file mode 100644 index 0000000..bb74fbe --- /dev/null +++ b/ios/patching/046-social-app-ios-null-url-guards.patch @@ -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 { + 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 { + 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 | undefined + + async function fetchAppConfig(): Promise { + try { ++ if (!APP_CONFIG_URL) return null + if (!fetchAppConfigPromise) { + fetchAppConfigPromise = (async () => { + const r = await fetch(`${APP_CONFIG_URL}/config`) diff --git a/ios/setup.zsh b/ios/setup.zsh index 62071d4..c970b1f 100755 --- a/ios/setup.zsh +++ b/ios/setup.zsh @@ -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() {