Skip to content

Releases: theophilusx/ssh2-sftp-client

Minor Bug Fix

23 Jun 05:02
Compare
Choose a tag to compare

Changed the error handlers on read/write streams to be 'on' rather than 'once' handlers. When definmed as 'once' handlers, multi8ple errors could result in the second error bubbling up to the top level and causing the node process to exit with an unhandled error event.

Also fixed a typo in an error code specification which could result in an undefined symbol error.

Fixed some documentation typos.

Major Version Change - Remove retry support

18 Mar 23:16
Compare
Choose a tag to compare

The main change in this version is the removal of the connectiuon retry support. There are 2 main reasons this support has been removed -

  • It provided little benefit over the added connection logic complexity. In 90% of cases, a connection which fails on the first attempt fails all subsequent retries. Very rarely does a connection which fails on the first attempt succeed with one of the retry attempts. This approach did have some benefit in the past when networks were slower and often more congested, but advances in technology, network speeds and infrastructure quality mean the sorts of problems we use to encounter and less prevelent.
  • The inclusion of retry support significantly complicates the event handling logic and creates some rare, but not unknown, corner cases where events don't get correctly handled and can result in the connection promise handing indefinitely, being neither resolved or rejected. The retry support also had a performance hit which could actually cause connection problems, especially on a slower network using a slower key excahgne or cipher.

The other reason to remove this support is that should someone want to have such support, it can easily be added in their own use case via one of the retry promise packages available and can be tailored to their specific needs. Maintaining a flexible and general implementation which did not have any negative impact is much harder and adds an additional maintenance burdon which is only beneficial for a small number of use cases.

The other change in this version is that we are no longer testing against v18.x of node. Highly recommended that at least version v20.x is used.

New event handling strategy

07 Aug 02:09
Compare
Choose a tag to compare

This release introduces a new event handling strategy.

  • Global event listeners no longer raise errors. Only log events and invalidate connection object.
  • Constructor allows passing in custom global event listeners whi8chn can do whatever is appropriate for the client
  • All temporary local event listeners wil now call the associated promise rejedct method. Previously reject was only called for error events, but this caused problems for some badly behaving sftp servers which ended connections without signalling any error condition. This would cause promises to be stuck in an unfulfilled state.

While the above changes do not change the existing API, the change in global listener behaviour may result in changes for client code behaviour, so this update is marked as a whole new version. However, most clients should not experience any change an in fact, things should be more stable with less liklihood of uncaught errors killing top level processes. It is expected that few clients will need to supply custom global event listeners as the defaults should work fror the vast majority of clients 'out of the box'. Chances are very high you will be able to update to this vwersion from 10.0.3 with no impact or nee3d for code change.

Documentation fix Mk2

22 Jan 11:36
Compare
Choose a tag to compare

Restore missing README.md file

Typo fix in packagte.json

22 Jan 07:54
Compare
Choose a tag to compare

Just a stupid fat finger error fix!

Minor documentation update

22 Jan 07:43
Compare
Choose a tag to compare

Minor update to documentation to add links to allow supporters to donate to the project to help with on-going maintenance and support.

Bug fix and security update

19 Jan 03:22
Compare
Choose a tag to compare
  • Bump to depend on ssh2 1.15.0, which has the fix for CVE-2023-48795
  • Add new promiseLimit setting to limit the number of concurrent promises used by downloadDir/uploadDir. Default is set to 10. Testing indicated for most situations, increasing much above 10 had little benefit and eventually, once number was large enough, actually degraded performance as node would spend more time context switching than data transferring.
  • Some minor code clenup and added quite a few new tests
  • Changed minimum supported node version. While testing with v16.20.2 still appears to work, it is HIGHLY recommended that at least node 18.18.2 is used. Bottom line, if you log an issue, you need to be on node >= v18.

Maintenance Release

02 May 23:22
Compare
Choose a tag to compare
  • Re-factoring of some methods to enable them to better catch network errors within surrounding promise.
  • Fix error in handling options in some methods which prevented setting file permissions
  • Added additional tests and test coverage

Minor bug fix release

04 Sep 21:41
Compare
Choose a tag to compare
  • Fixes an issue with module hanging and failing to return any error when a corrupted private key was supplied. Now returns an error that the module was unable to parse the private key.

Minor bug fix release

04 Aug 06:17
Compare
Choose a tag to compare

Fix two minor bugs

  • Sometimes, when initialisation of sftp sub-system failed, the module would attempt to call sftp.end(), which would fail with an undefined reference error

  • When calling the get() method and supplying a destination stream for the data, if the soruce file did not exist on the remote server, the destination stream was not closed and could result in a resource leak.