Skip to content

Commit

Permalink
filters property is no longer optional in the message descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
LiranCohen committed Jun 20, 2024
1 parent 0b1adbf commit 159dfa4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/handlers/events-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/events-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class EventsQuery extends AbstractMessage<EventsQueryMessage>{
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);
}
Expand Down

0 comments on commit 159dfa4

Please sign in to comment.