From d258a05165495732d3266e71f0fa40cfdc565bea Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Fri, 4 Dec 2026 23:01:09 -0500 Subject: [PATCH] test(postgres): log the history event before the first webhook endpoint exists Since #631 the first endpoint sets the dispatch cursor when it is created, so an event logged after that is delivered. The test still logged its history event after creating the endpoint and expected it to be skipped. --- tests/postgres/webhooks.spec.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/postgres/webhooks.spec.ts b/tests/postgres/webhooks.spec.ts index 2e1fa8c7..370da106 100644 --- a/tests/postgres/webhooks.spec.ts +++ b/tests/postgres/webhooks.spec.ts @@ -55,13 +55,12 @@ async function logEvent(type: string, userId: string, metadata: Record { it('starts after the newest event, then delivers each new one once, signed', async () => { + // Logged while no endpoint exists: the first endpoint starts after it, so it is not replayed. + await logEvent('user_deleted', '11111111-1111-4111-8111-111111111111'); const { secret } = await createEndpoint( { url: `http://127.0.0.1:${port}/hook`, eventTypes: ['user.deleted'] }, null, ); - - // Before the cursor exists: history is not replayed. - await logEvent('user_deleted', '11111111-1111-4111-8111-111111111111'); expect(await dispatchWebhooks()).toBe(0); await logEvent('user_deleted', '22222222-2222-4222-8222-222222222222');