From 64e49bca9d4e5c4b78f7b41d108138f00d847526 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 8 May 2024 17:11:48 -0500 Subject: [PATCH] EventsDB: fix postgres crash when there are no local users --- src/storages/events-db.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/storages/events-db.ts b/src/storages/events-db.ts index 53a307c..de1ec4a 100644 --- a/src/storages/events-db.ts +++ b/src/storages/events-db.ts @@ -235,8 +235,6 @@ class EventsDB implements NStore { /** Converts filters to more performant, simpler filters that are better for SQLite. */ async expandFilters(filters: NostrFilter[]): Promise { - filters = normalizeFilters(filters); // Improves performance of `{ kinds: [0], authors: ['...'] }` queries. - for (const filter of filters) { if (filter.search) { const tokens = NIP50.parseInput(filter.search); @@ -268,7 +266,7 @@ class EventsDB implements NStore { } } - return filters; + return normalizeFilters(filters); // Improves performance of `{ kinds: [0], authors: ['...'] }` queries. } /** Get events for filters from the database. */