diff --git a/e2e/playwright.config.js b/e2e/playwright.config.js index 3aae8bb..fd628ba 100644 --- a/e2e/playwright.config.js +++ b/e2e/playwright.config.js @@ -5,8 +5,12 @@ module.exports = defineConfig({ testMatch: '*.spec.js', timeout: 300_000, retries: 0, + expect: { + timeout: 10_000, + }, use: { baseURL: 'http://localhost:8889', + actionTimeout: 10_000, launchOptions: { args: ['--disable-dev-shm-usage'], }, diff --git a/web/public/app.js b/web/public/app.js index 0895a6e..a149a44 100644 --- a/web/public/app.js +++ b/web/public/app.js @@ -9,6 +9,10 @@ let selectedPrefix = null; let patchesLoaded = false; let isRestore = false; + let availablePatches = null; + + // Fetch patch index immediately so it's ready when needed. + const availablePatchesReady = scanAvailablePatches().then(p => { availablePatches = p; }); // DOM elements const stepNav = document.getElementById('step-nav'); @@ -108,9 +112,9 @@ manualMode = true; manualChromeHint.hidden = false; - const available = await scanAvailablePatches(); + await availablePatchesReady; manualVersion.innerHTML = ''; - for (const p of available) { + for (const p of availablePatches) { const opt = document.createElement('option'); opt.value = p.version; opt.textContent = p.version; @@ -166,8 +170,7 @@ if (!version || !selectedPrefix) return; try { - const available = await scanAvailablePatches(); - const loaded = await loadPatchesForVersion(version, available); + const loaded = await loadPatchesForVersion(version, availablePatches); if (!loaded) { showError('Could not load patches for software version ' + version); return; @@ -196,8 +199,8 @@ selectedPrefix = info.serialPrefix; - const available = await scanAvailablePatches(); - const match = available.find(p => p.version === info.firmware); + await availablePatchesReady; + const match = availablePatches.find(p => p.version === info.firmware); if (match) { deviceStatus.className = ''; diff --git a/web/public/index.html b/web/public/index.html index bbdbc63..cde4403 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -7,7 +7,7 @@ - +
@@ -246,9 +246,9 @@ - - - - + + + +