diff --git a/CHANGELOG.md b/CHANGELOG.md index 214116c..ead6893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the LaunchDarkly Node.js SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org). +## [4.0.5] - 2018-05-03 +### Fixed +- The waitUntilReady Promise will now resolve even after the ready event was emitted — thanks @dylanjha + ## [4.0.4] - 2018-04-17 ### Fixed - Fixed a bug that could cause a call stack overflow when calling `all_flags` with a very large number of flags, or evaluating a flag with a very large number of rules. This should no longer happen no matter how many flags or rules there are. diff --git a/index.js b/index.js index b7d7fbd..6eda8dc 100644 --- a/index.js +++ b/index.js @@ -121,7 +121,10 @@ var new_client = function(sdk_key, config) { } client.waitUntilReady = function() { - if (init_complete) return Promise.resolve() + if (init_complete){ + return Promise.resolve(); + } + return new Promise(function(resolve) { client.once('ready', resolve); }); diff --git a/package-lock.json b/package-lock.json index 12a1b4a..a984ea8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ldclient-node", - "version": "4.0.3", + "version": "4.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a4e3b24..caa8c75 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ldclient-node", - "version": "4.0.4", + "version": "4.0.5", "description": "LaunchDarkly SDK for Node.js", "main": "index.js", "scripts": {