diff --git a/plugins/events-backend/src/service/hub/DatabaseEventBusStore.ts b/plugins/events-backend/src/service/hub/DatabaseEventBusStore.ts index 600a038793..e5e69d697d 100644 --- a/plugins/events-backend/src/service/hub/DatabaseEventBusStore.ts +++ b/plugins/events-backend/src/service/hub/DatabaseEventBusStore.ts @@ -339,9 +339,9 @@ export class DatabaseEventBusStore implements EventBusStore { this.#db.ref('topics').withSchema('sub').wrap('ANY(', ')'), ) // Skip events that have already been consumed by this subscription - .where( + .whereNot( this.#db.raw('?', id), - '<>', + '=', this.#db.ref('consumed_by').withSchema('event').wrap('ANY(', ')'), ) .where('event.id', '>', this.#db.ref('read_until').withSchema('sub'))