Open wurzy opened 1 year ago
If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you. If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines. You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.
Describe the bug Whenever you instantiate a CubeJsApi with the WebSocket Transport method and you attempt to use its API, the application will block waiting for the server's response. If the server is offline or you provide an incorrect URL or the WebSockets are not enabled, the application will block indefinitely.
This does not happen in the default transport method.
To Reproduce This issue is easily reproducible, you don't even have to install Cube. Simply using the code below will show how the application blocks waiting for the response, which never arrives.
const cubejsApi = cubejs({ transport: new WebSocketTransport({ authorization: CUBEJS_TOKEN, apiUrl: 'ws://localhost:4000/', }), });
load
,dryRun
,meta
...Expected behavior The CubeJsApi API methods should not be executed indefinitely, they should have a timeout or a way to handle the cases where the request does not reach the server successfully or an error occurs.
Version: [v0.33.27]
Additional context