diff --git a/js/adminListStore.js b/js/adminListStore.js index 69e867a8..afed1d2f 100644 --- a/js/adminListStore.js +++ b/js/adminListStore.js @@ -202,6 +202,7 @@ function sanitizeAdminState(state = {}) { normalizeNpub(ADMIN_SUPER_NPUB), ...ADMIN_EDITORS_NPUBS.map(normalizeNpub), ...sanitizedEditors.map(normalizeNpub), + ...sanitizedWhitelist.map(normalizeNpub), ]); const sanitizedBlacklist = sanitizeNpubList(state.blacklist || []).filter( diff --git a/tests/admin-list-store.test.mjs b/tests/admin-list-store.test.mjs index bcf3df43..5cb39353 100644 --- a/tests/admin-list-store.test.mjs +++ b/tests/admin-list-store.test.mjs @@ -272,6 +272,14 @@ nostrClient.pool = { throw new Error("list failure for authors"); } + if (listFailureMode === "throw-community") { + const fullSourceTag = `${ADMIN_LIST_NAMESPACE}:${ADMIN_COMMUNITY_BLACKLIST_SOURCES}`; + const fullPrefix = `${ADMIN_LIST_NAMESPACE}:${ADMIN_COMMUNITY_BLACKLIST_PREFIX}`; + if (dTag === fullSourceTag || dTag.startsWith(fullPrefix)) { + throw new Error("list failure for community"); + } + } + const key = `${authorKey}::${dTag}`; const fallbackKey = `*::${dTag}`; const event = listEventRegistry.get(key) || listEventRegistry.get(fallbackKey); @@ -451,7 +459,7 @@ assert.deepEqual( setListFailureMode(null); resetListRegistry(); -setListFailureMode("throw-authors"); +setListFailureMode("throw-community"); registerListEvent({ dTag: editorsDTag,