From 159dfa43415fd641d2afe5d322fdb1742267b0b1 Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Thu, 20 Jun 2024 16:29:54 -0400 Subject: [PATCH] filters property is no longer optional in the message descriptor --- src/handlers/events-query.ts | 2 +- src/interfaces/events-query.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/handlers/events-query.ts b/src/handlers/events-query.ts index 2b8485758..e68042412 100644 --- a/src/handlers/events-query.ts +++ b/src/handlers/events-query.ts @@ -35,7 +35,7 @@ export class EventsQueryHandler implements MethodHandler { // if no filter is present in the the `EventsQuery` descriptor, we pass an empty array of filters to the `queryEvents` method // this will return all events in the event log for the given tenant beyond the cursor provided. // if no cursor is provided, it will return all events - const eventFilters = message.descriptor.filters ? Events.convertFilters(message.descriptor.filters) : []; + const eventFilters = Events.convertFilters(message.descriptor.filters); const { events, cursor } = await this.eventLog.queryEvents(tenant, eventFilters, message.descriptor.cursor); return { diff --git a/src/interfaces/events-query.ts b/src/interfaces/events-query.ts index b29a76d35..1df3f7cc5 100644 --- a/src/interfaces/events-query.ts +++ b/src/interfaces/events-query.ts @@ -23,7 +23,7 @@ export class EventsQuery extends AbstractMessage{ Message.validateJsonSchema(message); await Message.validateSignatureStructure(message.authorization.signature, message.descriptor); - for (const filter of message.descriptor.filters || []) { + for (const filter of message.descriptor.filters) { if ('protocol' in filter && filter.protocol !== undefined) { validateProtocolUrlNormalized(filter.protocol); }