From 413ec4b7ac4ee3911cbd54147d8a0f17aafa7ff4 Mon Sep 17 00:00:00 2001 From: trevor-signal <131492920+trevor-signal@users.noreply.github.com> Date: Tue, 6 Jan 2026 13:26:58 -0500 Subject: [PATCH] Add timeouts for TUS uploads --- ts/jobs/helpers/sendNormalMessage.preload.ts | 6 ++++++ ts/util/uploads/tusProtocol.node.ts | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ts/jobs/helpers/sendNormalMessage.preload.ts b/ts/jobs/helpers/sendNormalMessage.preload.ts index e901c6fc4b..a8a83d6435 100644 --- a/ts/jobs/helpers/sendNormalMessage.preload.ts +++ b/ts/jobs/helpers/sendNormalMessage.preload.ts @@ -140,6 +140,12 @@ export async function sendNormalMessage( return; } + log.info( + 'Sending normal message;', + `editedMessageTimestamp=${editedMessageTimestamp},`, + `storyMessage=${Boolean(message.attributes.storyId)}` + ); + // The original timestamp for this message const messageTimestamp = getMessageSentTimestamp(message.attributes, { includeEdits: false, diff --git a/ts/util/uploads/tusProtocol.node.ts b/ts/util/uploads/tusProtocol.node.ts index cd3e4f70c2..3b5a3b627f 100644 --- a/ts/util/uploads/tusProtocol.node.ts +++ b/ts/util/uploads/tusProtocol.node.ts @@ -8,6 +8,7 @@ import { createLogger } from '../../logging/log.std.js'; import * as Errors from '../../types/errors.std.js'; import { sleep } from '../sleep.std.js'; import { FIBONACCI_TIMEOUTS, BackOff } from '../BackOff.std.js'; +import { MINUTE } from '../durations/constants.std.js'; const log = createLogger('tusProtocol'); @@ -129,6 +130,7 @@ export async function _tusCreateWithUploadRequest({ }), 'Content-Type': 'application/offset+octet-stream', }, + timeout: MINUTE, // eslint-disable-next-line @typescript-eslint/no-explicit-any body: readable as any, }), @@ -256,6 +258,7 @@ export async function _tusResumeUploadRequest({ 'Upload-Offset': String(uploadOffset), 'Content-Type': 'application/offset+octet-stream', }, + timeout: MINUTE, // eslint-disable-next-line @typescript-eslint/no-explicit-any body: readable as any, }),