2. When a timeout occurs response gets sent as is which is something like below (my custom code written in catch block is triggered after some time after response is already sent to client ) :
{
"name": "RequestTimeoutError",
"message": "Request is timed out when call 'auth.initiateOTPFlow' action on '60015702438-17396' node.",
"code": 504,
"type": "REQUEST_TIMEOUT",
"data": {
"action": "auth.initiateOTPFlow",
"nodeID": "60015702438-17396"
}
}
This is causing uneven response to the my client.
Below is the error :
[2021-11-29T12:10:52.882Z] ERROR 60015702438-17396/API: Request error! RequestTimeoutError : Request is timed out when call 'auth.initiateOTPFlow' action on '60015702438-17396' node.
RequestTimeoutError: Request is timed out when call 'auth.initiateOTPFlow' action on '60015702438-17396' node. at D:\developement\ReactJs-Projects\selfservice-api\node_modules\moleculer\src\middlewares\timeout.js:42:14
at async Service.callAction (D:\developement\ReactJs-Projects\selfservice-api\node_modules\moleculer-web\src\index.js:616:16)
at async D:\developement\ReactJs-Projects\selfservice-api\node_modules\moleculer-web\src\index.js:443:22
Data: { action: 'auth.initiateOTPFlow', nodeID: '60015702438-17396' }
Getting similar issue on molecular web ^0.9.1 as https://github.com/moleculerjs/moleculer-web/issues/62 . My scenario :
{ "name": "RequestTimeoutError", "message": "Request is timed out when call 'auth.initiateOTPFlow' action on '60015702438-17396' node.", "code": 504, "type": "REQUEST_TIMEOUT", "data": { "action": "auth.initiateOTPFlow", "nodeID": "60015702438-17396" } }