Merge branch 'eventsdb-no-ephemeral' into 'main'

EventsDB: remove queries for ephemeral kinds

See merge request soapbox-pub/ditto!409
This commit is contained in:
Alex Gleason 2024-07-04 22:40:17 +00:00
commit 8923a5ee55

View file

@ -279,6 +279,12 @@ class EventsDB implements NStore {
filter.search = tokens.filter((t) => typeof t === 'string').join(' '); filter.search = tokens.filter((t) => typeof t === 'string').join(' ');
} }
if (filter.kinds) {
// Ephemeral events are not stored, so don't bother querying for them.
// If this results in an empty kinds array, NDatabase will remove the filter before querying and return no results.
filter.kinds = filter.kinds.filter((kind) => !NKinds.ephemeral(kind));
}
} }
return filters; return filters;