From abfabebcd6486106b7b9e87acfdb759834a375ec Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 18 Mar 2025 22:16:33 +0000 Subject: [PATCH] Rust crypto: set a timeout on outgoing HTTP requests --- src/rust-crypto/OutgoingRequestProcessor.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rust-crypto/OutgoingRequestProcessor.ts b/src/rust-crypto/OutgoingRequestProcessor.ts index 00ccb920ce9..2633c9d783f 100644 --- a/src/rust-crypto/OutgoingRequestProcessor.ts +++ b/src/rust-crypto/OutgoingRequestProcessor.ts @@ -219,6 +219,12 @@ export class OutgoingRequestProcessor { // we use the full prefix prefix: "", + + // We set a timeout of 60 seconds to guard against requests getting stuck forever and wedging the + // request loop (cf https://github.com/element-hq/element-web/issues/29534). + // + // (XXX: should we do this in the whole of the js-sdk?) + localTimeoutMs: 60000, }; return await this.http.authedRequest(method, path, queryParams, body, opts);