From 6d80b43335c8ba5a8c4c347d79a9f8b90b4ea9aa Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jan 2024 00:23:37 -0600 Subject: [PATCH] SearchStore: bail early for empty filters --- src/storages/search-store.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/storages/search-store.ts b/src/storages/search-store.ts index e957946c..c5a0a3c4 100644 --- a/src/storages/search-store.ts +++ b/src/storages/search-store.ts @@ -35,6 +35,10 @@ class SearchStore implements EventStore { opts?: GetEventsOpts | undefined, ): Promise[]> { filters = normalizeFilters(filters); + + if (opts?.signal?.aborted) return Promise.resolve([]); + if (!filters.length) return Promise.resolve([]); + this.#debug('REQ', JSON.stringify(filters)); const query = filters[0]?.search;