From 20b4e7b31c68d8f25cd7eb8a5103469258a3a093 Mon Sep 17 00:00:00 2001 From: yummybomb <19238148+yummybomb@users.noreply.github.com> Date: Thu, 11 Jun 2026 14:41:48 +0000 Subject: [PATCH] Dispatch start_url navigation asynchronously in chromium configure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The configure handler blocked its response on the start_url navigation dispatch (CDP dial + Page.navigate, up to 3s on a slow dial). Kick it in a goroutine instead: it still runs after profile install and chromium restart, so ordering relative to profile loading is unchanged, but the caller (the API's synchronous ConfigureAndClaimActivity) no longer waits on it. Navigation was already best-effort — failures only logged. --- server/cmd/api/api/chromium_configure.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/server/cmd/api/api/chromium_configure.go b/server/cmd/api/api/chromium_configure.go index 6fff956f..11f1a021 100644 --- a/server/cmd/api/api/chromium_configure.go +++ b/server/cmd/api/api/chromium_configure.go @@ -181,9 +181,15 @@ func (s *ApiService) ChromiumConfigure(ctx context.Context, request oapi.Chromiu } if spec.needsNav { - if err := chromiumDoNavigate(ctx, s, spec); err != nil { - logger.FromContext(ctx).Warn("start_url dispatch failed", "error", err) - } + // Dispatch navigation asynchronously so the configure response doesn't + // block on it. This runs after profile install and chromium restart, so + // the start_url ordering relative to profile loading is preserved. + navCtx := context.WithoutCancel(ctx) + go func() { + if err := chromiumDoNavigate(navCtx, s, spec); err != nil { + logger.FromContext(navCtx).Warn("start_url dispatch failed", "error", err) + } + }() } logger.FromContext(ctx).Info("chromium configure finished", "elapsed", time.Since(start).String())