mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-08 22:02:54 +00:00
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 <[email protected]>
This commit is contained in:
1 parent
4bfe605fed
commit
7a8c738a09
2 files changed
+25
-1
No files matched your search
@@ -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
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user