1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-07 23:02:56 +03:00

make delayed event restart localTimeoutMs configurable

This commit is contained in:
Timo
2025-07-15 17:06:29 +02:00
parent aa79236ce2
commit dd8fb7cf6c

View File

@@ -493,6 +493,12 @@ export interface IStartClientOpts {
*/
pollTimeout?: number;
/**
* The maximum amount of time to wait before timing out the `POST /_matrix/client/v1/delayed_events/{delay_id}` with `action = "restart"` requests.
* If not specified, the default `localTimeoutMs` will be used.
*/
delayedEventRestartLocalTimeoutMS?: number;
/**
* The filter to apply to /sync calls.
*/
@@ -3473,8 +3479,12 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
const data = {
action,
};
return await this.http.authedRequest(Method.Post, path, undefined, data, {
const opts = {
localTimeoutMs: action === "restart" ? this.clientOpts?.delayedEventRestartLocalTimeoutMS : undefined,
...requestOptions,
};
return await this.http.authedRequest(Method.Post, path, undefined, data, {
...opts,
prefix: `${ClientPrefix.Unstable}/${UNSTABLE_MSC4140_DELAYED_EVENTS}`,
});
}