Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:6
- image: redis
steps:
- checkout
- run: npm install
- run:
command: npm test
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
- store_test_results:
path: reports/junit
- store_artifacts:
path: reports/junit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
junit.xml
node_modules/
npm-debug.log
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.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.

## [4.0.3] - 2018-03-27
### Fixed
- Fixed a [bug](https://github.com/launchdarkly/node-client/issues/85) that would cause an unhandled promise rejection warning-- and, depending on your Node configuration, a crash-- if there was an HTTP error during an automatic event flush.
Expand Down
5 changes: 0 additions & 5 deletions circle.yml

This file was deleted.

4 changes: 2 additions & 2 deletions evaluate_flag.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function evalRules(flag, user, featureStore, cb) {
async.mapSeries(flag.rules,
function(rule, callback) {
rule_match_user(rule, user, featureStore, function(matched) {
callback(matched ? rule : null, null);
setImmediate(callback, matched ? rule : null, null);
});
},
function(err, results) {
Expand Down Expand Up @@ -154,7 +154,7 @@ function rule_match_user(r, user, featureStore, cb) {
function(clause, callback) {
clause_match_user(clause, user, featureStore, function(matched) {
// on the first clause that does *not* match, we raise an "error" to stop the loop
callback(matched ? null : clause, null);
setImmediate(callback, matched ? null : clause, null);
});
},
function(err, results) {
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ var new_client = function(sdk_key, config) {
// At the moment, we don't send any events here
evaluate.evaluate(flag, user, config.feature_store, function(err, result, events) {
results[key] = result;
iteratee_cb(null);
setImmediate(iteratee_cb);
})
}, function(err) {
return err ? reject(err) : resolve(results);
Expand Down
Loading