diff --git a/src/pipeline.ts b/src/pipeline.ts index ab303709..5becff20 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -31,8 +31,7 @@ const console = new Stickynotes('ditto:pipeline'); * It is idempotent, so it can be called multiple times for the same event. */ async function handleEvent(event: DittoEvent, signal: AbortSignal): Promise { - // Integer max value for Postgres. TODO: switch to a bigint in 2038. - if (event.created_at >= 2_147_483_647) { + if (eventAge(event) < -Time.minutes(1)) { throw new RelayError('invalid', 'event too far in the future'); } // Integer max value for Postgres.