From 1bf491a9995c6d5fc765deeeb7d0fc1d5427363c Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 22 Feb 2026 18:18:46 +0000 Subject: [PATCH] fix(ci): install firefox for headless e2e and safeguard app init - Updates `.github/workflows/ci.yml` to install `firefox` for the `e2e-headless` job, resolving the "Executable doesn't exist" error. - Updates `js/app.js` to make `_initAccessControl` async (returning a Promise) and adds a 15-second timeout safeguard. This ensures the app waits for ACLs to load (fixing the race condition) but doesn't hang indefinitely if the network is slow or unresponsive (fixing E2E timeouts). Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- js/app.js | 37 +++++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afcbe295..6dc5260c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -478,7 +478,7 @@ jobs: run: npm ci - name: Install Playwright browsers - run: npx playwright install --with-deps chromium + run: npx playwright install --with-deps chromium firefox - name: Run headless E2E tests run: npm run test:e2e diff --git a/js/app.js b/js/app.js index baff34a3..8bd8d854 100644 --- a/js/app.js +++ b/js/app.js @@ -928,8 +928,10 @@ class Application { } } - _initAccessControl() { - accessControl + async _initAccessControl() { + const promises = []; + + const aclRefreshPromise = accessControl .refresh() .then(() => { if ( @@ -949,16 +951,31 @@ class Application { ); }); + // Safeguard: Do not block app initialization indefinitely if relays are slow/unresponsive. + // 15s gives plenty of time for a healthy connection but prevents E2E test timeouts (60s). + const timeoutPromise = new Promise((resolve) => { + setTimeout(() => { + devLogger.warn("[app.init()] Access control refresh timed out; proceeding without full admin state."); + resolve(); + }, 15000); + }); + + promises.push(Promise.race([aclRefreshPromise, timeoutPromise])); + if (this.profileController) { - Promise.resolve() - .then(() => this.profileController.refreshAdminPaneState()) - .catch((error) => { - devLogger.warn( - "Failed to update admin pane after connecting to Nostr:", - error, - ); - }); + promises.push( + Promise.resolve() + .then(() => this.profileController.refreshAdminPaneState()) + .catch((error) => { + devLogger.warn( + "Failed to update admin pane after connecting to Nostr:", + error, + ); + }) + ); } + + await Promise.all(promises); } async _syncSessionActorBlacklist(trigger) {