From 2148973cf6173e138c7aa765cbf1b9048c4e0f1b Mon Sep 17 00:00:00 2001 From: ChuckBuilds Date: Thu, 26 Mar 2026 11:16:00 -0400 Subject: [PATCH] fix(web): add fetch timeout to loadPluginsDirect fallback Add AbortController with 10s timeout so a hanging fetch doesn't leave data-loaded set and block retries. Timer is cleared in both success and error paths. Co-Authored-By: Claude Opus 4.6 (1M context) --- web_interface/templates/v3/base.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web_interface/templates/v3/base.html b/web_interface/templates/v3/base.html index 557f82c6..c0975c10 100644 --- a/web_interface/templates/v3/base.html +++ b/web_interface/templates/v3/base.html @@ -401,12 +401,15 @@ if (content && !content.hasAttribute('data-loaded')) { content.setAttribute('data-loaded', 'true'); console.log('Loading plugins directly via fetch (HTMX fallback)...'); - fetch('/v3/partials/plugins') + const controller = new AbortController(); + const timeout = setTimeout(() => controller.abort(), 10000); + fetch('/v3/partials/plugins', { signal: controller.signal }) .then(r => { if (!r.ok) throw new Error(r.status + ' ' + r.statusText); return r.text(); }) .then(html => { + clearTimeout(timeout); content.innerHTML = html; // Trigger full initialization chain if (window.pluginManager) { @@ -418,6 +421,7 @@ } }) .catch(err => { + clearTimeout(timeout); console.error('Failed to load plugins:', err); content.removeAttribute('data-loaded'); content.innerHTML = '

Failed to load Plugin Manager. Please refresh the page.

';