From 4afde880d261a98197b1671188f4fca604e0fe26 Mon Sep 17 00:00:00 2001 From: pavlov346346-source Date: Sat, 12 Sep 2026 18:37:56 +0300 Subject: [PATCH] revert: back out the api.caterium.ru fetch rewrite for now MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commit accidentally carried over an uncommitted proxy cutover (supabaseProxyFetch wired into createClient's global.fetch) that was left sitting in the working tree from an earlier, paused verification session - it was never meant to ship without first completing the full checklist (auth, clients, orders, Storage, Functions) against the live proxy. Reverting just that piece so main goes back to calling cksuehzcimitsxmeloes.supabase.co directly, keeping the "Загрузить из облака" button fix from the same commit. The proxy cutover will come back once it's actually been verified end-to-end. Co-Authored-By: Claude Sonnet 5 --- public/app-runtime.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/public/app-runtime.js b/public/app-runtime.js index 33f271e..8629180 100644 --- a/public/app-runtime.js +++ b/public/app-runtime.js @@ -1988,22 +1988,6 @@ window.SUN_LEGACY_CATALOG_V175=[{"id":"1","name":"Фуршетный бокс const DEFAULT_SUPABASE_URL = 'https://cksuehzcimitsxmeloes.supabase.co'; const DEFAULT_SUPABASE_KEY = 'sb_publishable_v8Z3hEBnu7zsDwAb5KCWcg_T96IejsM'; - // REST/Auth/Storage/Functions traffic to DEFAULT_SUPABASE_URL is routed through a - // same-region reverse proxy on Timeweb so it isn't a direct request to *.supabase.co - // (some Russian ISPs throttle/drop those). Realtime keeps using DEFAULT_SUPABASE_URL - // directly - a PHP proxy can't handle a WebSocket upgrade - and the app already - // degrades gracefully when Realtime can't connect. - const SUPABASE_API_PROXY = 'https://api.caterium.ru'; - function supabaseProxyFetch(input, init) { - try { - const url = typeof input === 'string' ? input : input?.url; - if (url && url.indexOf(DEFAULT_SUPABASE_URL) === 0) { - const proxied = SUPABASE_API_PROXY + url.slice(DEFAULT_SUPABASE_URL.length); - input = typeof input === 'string' ? proxied : new Request(proxied, input); - } - } catch (_) {} - return fetch(input, init); - } let config = loadConfig(); let client = null; @@ -2957,7 +2941,7 @@ window.SUN_LEGACY_CATALOG_V175=[{"id":"1","name":"Фуршетный бокс await loadSupabaseLibrary(); const signature=`${config.url}|${config.key}`; if(!client||signature!==clientSignature){ - client=window.supabase.createClient(config.url,config.key,{auth:{persistSession:true,autoRefreshToken:true,detectSessionInUrl:true},global:{fetch:supabaseProxyFetch}});clientSignature=signature; + client=window.supabase.createClient(config.url,config.key,{auth:{persistSession:true,autoRefreshToken:true,detectSessionInUrl:true}});clientSignature=signature; client.auth.onAuthStateChange((_event,next)=>{session=next;membershipsLoading=Boolean(next?.user);membershipsLoaded=!next?.user;setTimeout(async()=>{try{if(!next?.user){const sw=await switchTenantLocal('');if(sw.changed){location.reload();return;}}else{const sw=await loadMemberships();if(sw){location.reload();return;}}}finally{renderCloudUI();updatePill();}},0);}); } const {data,error}=await client.auth.getSession();if(error)throw error;session=data.session||null;