You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to interrupt long request by leveraging the timeout option available on the Vonage client object but it does not behave as expected.
Expected Behavior
The request should throw a timeout exception when said request is taking too much time.
Current Behavior
No exception is raised and the request keeps running beyond the timeout limitation.
Possible Solution
The timeout option is explicitly ignored in the code as you can see here
Steps to Reproduce (for bugs)
Here is a code snippet describing the usage and the expected behavior
import{Auth}from'@vonage/auth';import{Vonage}from'@vonage/server-sdk';importtype{SMSMessages}from'@vonage/sms/dist/types';constrequestTimeout=1;// in milliseconds I supposed. It is nowhere to be found in documentationconstclient: Vonage=newVonage(newAuth({apiKey: <my-api-key>,apiSecret: <my-api-secret>,}),{responseType: undefined,restHost: <vonage-api-host>,timeout: requestTimeout,// This timeout option is being completely ignoredvideoHost: undefined,apiHost: undefined,},);constsendSMS=(phone: string,message: string,from: string): Promise<SMSMessages>=>{returnclient.sms.send({to: phone,
from,text: message,clientRef: config.clientName,});}// This following call should fail due to timeout parameter being provided with a small value// But it always succeeds, completely ignoring the timeout option provided to the clientsendSMS('1233456987','Message that shouldn'tgetsentbecauseoftimeout','Timeout').then((res)=>console.log(res)).catch((error)=>console.log(error));
Context
We are trying to avoid SMS sending jobs locking our dedicated fast running worker due to requests taking too much time to be executed.
Your Environment
SDK Version: 3.2.0
Node Version: 18.15.0
Operating System and version: alpine:3
The text was updated successfully, but these errors were encountered:
Thank you @manchuck for the fix at the library level. Unfortunately the fix seems incomplete as from the client side, the timeout configuration option is explicitly set to null as you can see here.
Is it possible for you to set that configuration ?
I'm trying to interrupt long request by leveraging the timeout option available on the Vonage client object but it does not behave as expected.
Expected Behavior
The request should throw a timeout exception when said request is taking too much time.
Current Behavior
No exception is raised and the request keeps running beyond the timeout limitation.
Possible Solution
The timeout option is explicitly ignored in the code as you can see here
Steps to Reproduce (for bugs)
Here is a code snippet describing the usage and the expected behavior
Context
We are trying to avoid SMS sending jobs locking our dedicated fast running worker due to requests taking too much time to be executed.
Your Environment
The text was updated successfully, but these errors were encountered: