From 7a8c738a09c7d679c80a69851810118a09d30d71 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 19:05:27 +0000 Subject: [PATCH] fix(ci): install firefox in e2e-headless and fix admin list race condition - Update .github/workflows/ci.yml to install firefox for e2e-headless job - Update js/adminListStore.js to await nostrClient.initPromise if pool is not ready, preventing race conditions during app startup Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- js/adminListStore.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) 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/adminListStore.js b/js/adminListStore.js index afed1d2f..9f2805c2 100644 --- a/js/adminListStore.js +++ b/js/adminListStore.js @@ -523,6 +523,18 @@ function extractNpubsFromEvent(event) { async function fetchLatestListEvent(filter, contextLabel = "admin-list") { const nostrClient = requireNostrClient(); + + if (!nostrClient.pool && nostrClient.initPromise) { + try { + await nostrClient.initPromise; + } catch (error) { + devLogger.warn( + `[adminListStore] Awaiting nostrClient init failed during ${contextLabel} fetch:`, + error, + ); + } + } + const relays = ensureNostrReady(); const kind = (Array.isArray(filter?.kinds) && filter.kinds.length) @@ -827,6 +839,18 @@ function publishListWithFirstAcceptance(pool, relays, event, options = {}) { async function persistNostrState(actorNpub, updates = {}) { const nostrClient = requireNostrClient(); + + if (!nostrClient.pool && nostrClient.initPromise) { + try { + await nostrClient.initPromise; + } catch (error) { + devLogger.warn( + "[adminListStore] Awaiting nostrClient init failed during persist:", + error, + ); + } + } + ensureNostrReady(); const permissionResult = await requestDefaultExtensionPermissions(); if (!permissionResult.ok) {