hubiinetwork / nahmii-sdk

Javascript SDK for using the hubii nahmii APIs
http://hubii.com
GNU Lesser General Public License v3.0
8 stars 0 forks source link

Request hangs #134

Closed hubiierik closed 4 years ago

hubiierik commented 4 years ago

When an request is issued to the Nahmii back-end, it happens that the request hangs.

The internal feature NahmiiRequest is using super agent requests. The requests are made without timeout option.

Propose to add a timeout argument to the constructor of the NahmiRequests class.

hubiierik commented 4 years ago

Adding timeout to superagent works but there is a bug in superagent that impacts the way the timeout is reported.

Expected: ETIMEDOUT Got: ABORTED

This means that unit tests must check for 'Abort' message at timeout instead of 'Response timeout' The same issue also seems to have an impact on superagent retry feature where some claim that the retry feature does not work with superagent promise calls.

See: https://github.com/visionmedia/superagent/issues/1487

hubiierik commented 4 years ago

Done