Release v2.2.0 of the Amazon QLDB Driver for Node.js
Release v2.2.0
This release is focused on improving the retry logic, optimizing it and handling more possible failures, as well as more
strictly defining the API to help prevent misuse. These changes are potentially breaking if the driver is being used in
a way that isn't supported by the documentation.
🎉 Enhancements
- Improved retry logic
- Failures when starting a new session are now retried.
- Dead sessions are immediately discarded, reducing latency when using the driver.
ClientError,DriverClosedError,LambdaAbortedError, andSessionPoolEmptyErrorare now exported.- Peer dependency
aws-sdkbumped to2.841.0or greater, which gives visibility toCapacityExceededException.
- Updated the exponential backoff algorithm to better align with the algorithm specified here.
- Specify minimum Node.js version to 10.0 in package.json.
⚠️ API Clean-up
These changes either remove unintentionally exported modules or remove the use of any. Updating to 2.2.0 should not break any documented usage of the driver and should not require code changes. If something is now incompatible and it's believed that it should be, please open an issue.
-
TypeScript: updated
executeLambdasignature-
// Old async ExecuteLambda(transactionLambda: (transactionExecutor: TransactionExecutor) => any, retryConfig?: RetryConfig): Promise<any>; // New async ExecuteLambda<Type>(transactionLambda: (transactionExecutor: TransactionExecutor) => Promise<Type>, retryConfig?: RetryConfig): Promise<Type>;
-
The returned value from the
transactionLambdais whatExecuteLambdareturns, so it's now strictly defined by theType. -
The
transactionLambdamust return aPromise, as any methods called on theTransactionExecutormust be awaited for the driver to properly function.
-
-
JavaScript: removed
QldbDriver.getSession()- This is unavailable to TypeScript users and was not intended to be called directly by JavaScript users.
-
Module exports
- Removed
Transactionfrom the exports list. - Removed modules being accessible when importing from
amazon-qldb-driver-nodejs/src. - TypeScript: Removed constructors in the API for some exported types.
- Removed
🐛 Bug Fixes
- Fixed a bug where
No open transactionorTransaction already openerrors would occur