From 66bb08940c92f1fcd5c90fe90a872288d4ce15ae Mon Sep 17 00:00:00 2001 From: tristantr Date: Tue, 26 May 2026 14:53:18 +0200 Subject: [PATCH] perf(deploy-to-hub): parallelize public-app URL resolution resolvePublicUrl now runs once per anonymous app via Promise.all instead of serially inside the items loop, removing N round-trips from initial tab load. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../lib/components/workspaceSettings/DeployToHub.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/workspaceSettings/DeployToHub.svelte b/frontend/src/lib/components/workspaceSettings/DeployToHub.svelte index 072f5fb917..654b4ae50b 100644 --- a/frontend/src/lib/components/workspaceSettings/DeployToHub.svelte +++ b/frontend/src/lib/components/workspaceSettings/DeployToHub.svelte @@ -186,6 +186,11 @@ workspaceRateLimit = settings?.public_app_execution_limit_per_minute const next: DeployItem[] = [] + const publicApps = apps.filter((a) => a.execution_mode === 'anonymous') + const publicUrls = await Promise.all( + publicApps.map((a) => resolvePublicUrl(workspace, a.path)) + ) + const publicUrlByPath = new Map(publicApps.map((a, i) => [a.path, publicUrls[i]])) for (const a of apps) { const isPublic = a.execution_mode === 'anonymous' next.push({ @@ -195,7 +200,7 @@ summary: a.summary, rec: 'none', published: isPublic, - publicUrl: isPublic ? await resolvePublicUrl(workspace, a.path) : undefined + publicUrl: isPublic ? publicUrlByPath.get(a.path) : undefined }) } for (const a of rawApps) {