Improve DVM feeds

This commit is contained in:
Jon Staab
2024-04-25 15:42:48 -07:00
parent d2ac9d1839
commit b88c074d86
11 changed files with 71 additions and 28 deletions
+5
View File
@@ -39,6 +39,11 @@ export class FeedLoader<E extends Rumor> {
}
async _getRequestLoader({relays, filters}: RequestItem, {onEvent, onExhausted}: LoadOpts<E>) {
// Make sure we have some kind of filter to send if we've been given an empty one, as happens with relay feeds
if (filters.length === 0) {
filters = [{}]
}
const untils = filters.flatMap((filter: Filter) => filter.until ? [filter.until] : [])
const sinces = filters.flatMap((filter: Filter) => filter.since ? [filter.since] : [])
const maxUntil = untils.length === filters.length ? max(untils) : now()