File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import { describe , expect , it } from "vitest" ;
44import { MAX_TIMER_TIMEOUT_MS } from "../../shared/number-coercion.js" ;
55import { GATEWAY_CLIENT_MODES , GATEWAY_CLIENT_NAMES } from "../../utils/message-channel.js" ;
6- import { resolveOutboundMessageGatewayOptions } from "./message-gateway-options.js" ;
6+ import {
7+ DEFAULT_OUTBOUND_MESSAGE_GATEWAY_TIMEOUT_MS ,
8+ resolveOutboundMessageGatewayOptions ,
9+ } from "./message-gateway-options.js" ;
710
811describe ( "resolveOutboundMessageGatewayOptions" , ( ) => {
12+ it ( "waits long enough for bounded provider sends to finish" , ( ) => {
13+ expect ( resolveOutboundMessageGatewayOptions ( ) . timeoutMs ) . toBe (
14+ DEFAULT_OUTBOUND_MESSAGE_GATEWAY_TIMEOUT_MS ,
15+ ) ;
16+ } ) ;
17+
918 it ( "clamps oversized gateway timeouts" , ( ) => {
1019 expect (
1120 resolveOutboundMessageGatewayOptions ( { timeoutMs : Number . MAX_SAFE_INTEGER } ) . timeoutMs ,
Original file line number Diff line number Diff line change 88 type GatewayClientName ,
99} from "../../utils/message-channel.js" ;
1010
11+ export const DEFAULT_OUTBOUND_MESSAGE_GATEWAY_TIMEOUT_MS = 75_000 ;
12+
1113/** Raw gateway options accepted by outbound message senders. */
1214export type OutboundMessageGatewayOptionsInput = {
1315 url ?: string ;
@@ -30,7 +32,10 @@ export function resolveOutboundMessageGatewayOptions(gateway?: OutboundMessageGa
3032 return {
3133 url,
3234 token : gateway ?. token ,
33- timeoutMs : resolveTimerTimeoutMs ( gateway ?. timeoutMs , 10_000 ) ,
35+ timeoutMs : resolveTimerTimeoutMs (
36+ gateway ?. timeoutMs ,
37+ DEFAULT_OUTBOUND_MESSAGE_GATEWAY_TIMEOUT_MS ,
38+ ) ,
3439 clientName,
3540 clientDisplayName : gateway ?. clientDisplayName ,
3641 mode,
You can’t perform that action at this time.
0 commit comments