events-backend: fix error when reading subscription with empty events table
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -379,7 +379,7 @@ describe('eventsPlugin', () => {
|
||||
await helper.subscribe('tester', ['test']).expect(201);
|
||||
|
||||
jest.useFakeTimers({
|
||||
doNotFake: ['nextTick'],
|
||||
advanceTimers: true,
|
||||
});
|
||||
|
||||
try {
|
||||
|
||||
@@ -447,7 +447,7 @@ export class DatabaseEventBusStore implements EventBusStore {
|
||||
// events where read, the last ID out of all events
|
||||
.update({
|
||||
read_until: this.#db.raw(
|
||||
'COALESCE(last_event_id, (SELECT MAX(id) FROM event_bus_events))',
|
||||
'COALESCE(last_event_id, (SELECT MAX(id) FROM event_bus_events), 0)',
|
||||
),
|
||||
})
|
||||
.updateFrom({
|
||||
|
||||
Reference in New Issue
Block a user