mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
Merge branch 'future-block' into 'main'
pipeline: block events too far in the future See merge request soapbox-pub/ditto!607
This commit is contained in:
commit
75f9c90a8c
1 changed files with 1 additions and 2 deletions
|
|
@ -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<void> {
|
||||
// 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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue