add subscription upgrade plan
Build & Push / Pipeline Tests (push) Failing after 2m0s
Build & Push / Build & Push Docker Image (push) Has been skipped
Test / Type Check (all packages) (push) Successful in 53s
Test / API Unit Tests (push) Successful in 1m8s
Test / Homepage Unit Tests (push) Successful in 48s
Test / Carplace Unit Tests (push) Successful in 42s
Test / Admin Unit Tests (push) Successful in 41s
Test / Dashboard Unit Tests (push) Successful in 43s
Test / API Integration Tests (push) Failing after 1m7s

This commit is contained in:
root
2026-08-10 23:23:58 -04:00
parent 5f06256271
commit 7b8f81336a
15 changed files with 1957 additions and 104 deletions
+21 -6
View File
@@ -55,14 +55,29 @@ export function resolveApiOrigin(): string | null {
export function resolveRealtimeSocketTarget(): { origin: string; path: string } | null {
if (typeof window === 'undefined') return null
const apiBase = resolveApiBase()
const isDashboardProxy = apiBase === DASHBOARD_PROXY_API_BASE || apiBase.startsWith(`${DASHBOARD_PROXY_API_BASE}/`)
const origin = isDashboardProxy ? window.location.origin : resolveApiOrigin()
if (!origin) return null
const configuredApiBase = process.env.NEXT_PUBLIC_API_URL
if (configuredApiBase && !configuredApiBase.startsWith('/')) {
try {
return {
origin: new URL(normalizeApiBase(configuredApiBase)).origin,
path: '/socket.io',
}
} catch {
return null
}
}
const currentHostname = window.location?.hostname
if (currentHostname && isLocalBrowserHost(currentHostname)) {
return {
origin: 'http://localhost:4000',
path: '/socket.io',
}
}
return {
origin,
path: isDashboardProxy ? '/dashboard/socket.io' : '/socket.io',
origin: resolveApiOrigin() ?? window.location.origin,
path: '/socket.io',
}
}