Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

DeprecationWarning: Buffer() #184

Closed
vdabar opened this issue Apr 16, 2020 · 18 comments
Closed

DeprecationWarning: Buffer() #184

vdabar opened this issue Apr 16, 2020 · 18 comments

Comments

@vdabar
Copy link

vdabar commented Apr 16, 2020

Describe the bug
When I initialize launch-darkly-sdk-client I keep getting this error:
"[DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead."

To reproduce

import * as LaunchDarkly from 'launchdarkly-node-server-sdk';
import DynamoDBFeatureStore from 'launchdarkly-node-server-sdk-dynamodb';

let ldClient: LaunchDarkly.LDClient;

export async function init(launchDarklyStoreTable: string, launchDarklySdkKey: string) {
  const store = DynamoDBFeatureStore(launchDarklyStoreTable);
  const config = {
    featureStore: store,
    useLdd: true
  };
  ldClient = LaunchDarkly.init(launchDarklySdkKey, config);
  await ldClient.waitForInitialization();
}

Expected behavior
Not to print DeprecationWarning: Buffer() error

SDK version
5.13.0

Language version, developer tools
node v10.18.1

Additional context
I believe this error comes from Redis dependency, which needs to be updated to 3.x.x version

@eli-darkly
Copy link
Contributor

I believe this error comes from Redis dependency, which needs to be updated to 3.x.x version

I'm not sure how that could be the reason, if you're seeing this warning at runtime rather than at build time and you're not actually using Redis.

@eli-darkly
Copy link
Contributor

Also, I've been unable to reproduce this behavior. I am running in Node 10.18.1, with launchdarkly-node-server-sdk 5.13.0 and launchdarkly-node-server-sdk-dynamodb 1.1.9. The only difference between my test code and yours is that mine isn't in TypeScript, because I wanted to keep the dependencies as minimal as possible. In any case, I don't get any deprecation warning when I initialize the client.

@eli-darkly
Copy link
Contributor

I also would not expect any database integration code to execute in this particular test code. You are setting useLdd: true, which means it will not try to connect to LaunchDarkly at all, it will just read flags as needed from the database - but in our example, you're not evaluating any flags. Therefore it's not going to do any DynamoDB operations— you'll see this if you set launchDarklyStoreTable to a nonexistent table name; it makes no difference, because it's not actually trying to do anything with the table.

But even if I change this so that it does evaluate a flag, I don't get any deprecation warning,.

@vdabar
Copy link
Author

vdabar commented Apr 17, 2020

@eli-darkly thx for quick reply, apparently it happens when it's bundled with webpack. I have prepared an example: https://github.com/vdabar/launch-darkly-webpack-example
In order to replicate it run those commands:

cd launch-darkly-webpack-example
npm install
npm run build
node dist/main.js

@eli-darkly
Copy link
Contributor

eli-darkly commented Apr 17, 2020

I'm not sure why you're using webpack for Node code (the server-side Node SDK should never be run in a browser), but that does explain why you'd be seeing the warning only in that context.

As documented (see the "History" sections for the deprecated constructors), there's some logic that suppresses the warning if the constructor is being called from anywhere inside node_modules. I assume that the rationale was that lots and lots of packages still used those constructors, so application developers might not really have the option of eliminating all such usages that might be in transitive dependencies and so the warning would just be useless and annoying; in other words, they just wanted to encourage application developers to get rid of those usages in their own code. But, in the webpacked version of the code, those dependencies aren't in node_modules any more and so you see the warning.

Again, I don't know why you've assumed that the Redis code is to blame. It's true that the 2.x driver includes deprecated usages, and it does make sense for us to update that package... but that code is not executing in your program at all, and there's no mechanism for its mere presence in the source file to cause the warning to appear. I think it's much more likely that another dependency is to blame: grep -r 'new Buffer(' node_modules shows matches in at least 11 non-Redis packages (not including packages that are just brought in by webpack). I'd have to take a closer look to see which ones are more likely to be actually in use, but my point is that I think even if we updated the Redis dependency immediately, it would probably not make this warning go away. And, given that we have only limited control of transitive dependencies, it may or may not be possible to completely eliminate the warning even if we update to the latest versions of everything we're using. But I'll look into it.

@eli-darkly
Copy link
Contributor

To test that theory, I modified a local copy of the Node SDK to update the redis package to 3.0.2, rebuilt your example app using that modified SDK, and reran the build and the app. The same warning appeared.

@vdabar
Copy link
Author

vdabar commented Apr 20, 2020

We have monorepo setup for serverless functions and to prepare small bundles we use webpack with parameter target: node. if you also install asn1.js version 5.3 as a dependency it should fix all the warnings. I added a working example with updates packages in the same repo just install packages with npm ci. For sure this solution wouldn't solve the problem permanently but at least it should be fine until next function deprecation.

@eli-darkly
Copy link
Contributor

@vdabar Could you say more about how you determined that asn1.js was the package you should add an explicit dependency for? That is not a dependency of the Node SDK at all, not even a distant transitive dependency, as far as I can tell.

@eli-darkly
Copy link
Contributor

It's possible that the reason this is working for you is that one of its transitive dependencies is the thing we actually need to update - but if so, we should do specifically that, not introduce a new dependency on something we don't otherwise need.

@vdabar
Copy link
Author

vdabar commented Apr 21, 2020

What I wanted to say that in launchdarkly-node-server-sdk package the only one dependency still using deprecated Buffer is Redis. Asn1.js dependency comes from webpack and it's just a resolution hack to show you that bump of the Redis version fixes issue with your package.

@eli-darkly
Copy link
Contributor

What I wanted to say that in launchdarkly-node-server-sdk package the only one dependency still using deprecated Buffer is Redis. Asn1.js dependency comes from webpack and it's just a resolution hack to show you that bump of the Redis version fixes issue with your package.

I'm not sure what the difficulty in communication is here and I'm sorry if I was unclear, but as I tried to say earlier:

  1. It is not true that the only dependency still using a deprecated Buffer constructor is Redis. This can be easily verified by the grep search that I mentioned.

  2. It is impossible for any code in the redis package to be executed in your test scenario, so that package by itself cannot be the cause of the warning you saw. And I proved this by updating the redis version in the SDK, rebuilding your test app using that hacked SDK, and observing the same warning.

Both of those things are true to the best of my knowledge... so I'm not sure why you answered my question about the asn1.js package by telling me once again that this is all about Redis.

Again, asn1.js is not a direct dependency of our SDK, and it is not a transitive dependency either. You can easily verify that with npm ls. (There is a completely different package called just asn1, but it is only a dev dependency.) So this is why I asked: "Could you say more about how you determined that asn1.js was the package you should add an explicit dependency for?" In other words, what was your process for coming up with that solution, because it seems fairly arbitrary to me. When you say "asn1.js dependency comes from webpack and it's just a resolution hack", it's not clear to me what you mean by that in this context.

The other problem is that I cannot get your solution to work for me at all. That is:

  • I took the latest version of your test repo that has both the new asn1.js dependency and the updated redis dependency, and checked it out in a new directory to be sure that I was doing a completely clean build. This is in Node 10.18.1.
  • npm install fails: No matching version found for @types/[email protected].

@eli-darkly
Copy link
Contributor

I mean, if I do npm ci instead of npm install, then it does work, but that just means that the build will only work as long as your package-lock.json stays the same— in other words, what you have in package.json is not adequate for building the project from scratch. So that is not a usable solution.

@vdabar
Copy link
Author

vdabar commented Apr 22, 2020

Of course, it won't work with npm install, because I manually bumped up Redis version in launch-darkly-server-sdk via package-lock.json. grep search method found all deprecated values in other dependencies such as webpack in this case. However, if you search only in your package tree there are no other packages that use deprecated Buffer. Also, as you said asn1.js is not a direct dependency of your SDK, it's a transitive dependency of webpack and it's just added to resolve the same issue from other packages.

@vdabar
Copy link
Author

vdabar commented Apr 22, 2020

I understand that given code snippet never reaches that code, however, since your package makes the switch between different stores so easy it could change anytime soon and it would be nice to have the latest dependencies with as little deprecated code as possible.

@eli-darkly
Copy link
Contributor

I understand that given code snippet never reaches that code, however, since your package makes the switch between different stores so easy it could change anytime soon and it would be nice to have the latest dependencies with as little deprecated code as possible.

I feel like this conversation is going around in circles a bit. I've already said several times that yes, it would be a good idea for us to update the Redis package. The point I was making was that the entire premise of the issue you filed— that the warning you were seeing was due to the Redis package— is false, and all of the test cases you proposed, including the last one, are still going on that wrong premise.

When you updated your test repo and said "Asn1.js dependency comes from webpack and it's just a resolution hack to show you that bump of the Redis version fixes issue with your package", you weren't actually showing any such thing. If you had not updated Redis in that test, but only updated asn1.js, the warning would have still gone away, because none of the Redis code is executing in your test. You were simply testing that you had made warnings from webpack dependencies go away.

Similarly, after we update the Redis version, I do not think those warnings are going to go away for you unless you continue to use your webpack dependency hack. That part is something we can't control. And the approach that you used— manually editing only package-lock.json— is not something we can use, for reasons that should be obvious; when trying to illustrate a solution to a problem, it's usually better to use a technique that the other person can actually reproduce.

But in any case I think we've discussed this enough and the basic point is clear.

@eli-darkly
Copy link
Contributor

[tracked internally as 74036]

@eli-darkly
Copy link
Contributor

I should mention that one potential issue with updating to redis 3.x, although I think in practice it will not be a big deal, is that our SDK's Redis integration allows you to pass in an existing Redis client object. So there may be an application that is currently using redis 2.x, and passes a 2.x Redis client into the SDK which internally depends on 3.x. But as far as I can tell, none of the breaking changes in the 3.x API should affect our own fairly simple usage of the package. If it turns out that they do, then we would need to postpone this update until the next major version release of the SDK when breaking changes would be OK.

@eli-darkly
Copy link
Contributor

The Redis driver has been updated in the 5.13.1 release. This should not affect any existing applications, since none of the Redis APIs that we use have changed.

LaunchDarklyReleaseBot added a commit that referenced this issue Feb 19, 2022
* fix tests

* object shorthand

* add more end-to-end tests, improve HTTP test helpers, general cleanup

* rm nock

* Node 6 compatibility

* remove redundant helper, misc cleanup

* Node 6 compatibility

* fix comment

* change asyncify to promisifySingle

* misc fixes

* add Windows CircleCI job

* fix config

* syntax

* diagnostic events, part 2: initial event and stats, except for stream inits

* comments

* add test for stats event

* capture stream connection stats in diagnostic events

* fix test

* remove eventReportingDisabled from diagnostic event; only create diagnosticsManager if needed

* revise tests to use new helper package

* misc cleanup

* use launchdarkly-js-test-helpers 1.0.0

* fix package reference

* minor fixes to config validation messages + add comment

* diagnostic eventsInQueue counter should be # of events at last flush

* rename eventsInQueue to eventsInLastBatch

* don't let user fall outside of last bucket in rollout

* add unit tests for basic bucketing logic and edge case

* avoid redundant property lookups

* fix Redis client parameter to match TS declaration (but still support old incorrect parameter)

* add event payload ID

* remove mistakenly checked-in test code (note, this SDK key was only valid on staging)

* add mention of singleton usage

* update diagnostic event info for OS name, data store type, Node version

* standardize linting

* disallow window and document

* fix null/undef checks

* misc linting fixes

* inlineUsersInEvents is not an unknown option

* drop node-sha1 dependency

* don't omit streamInits.failed when it's false

* bump request dependency to get security patch; loosen some exact dependencies

* remove request package; improve polling cache logic + add test

* bump typescript version to fix build error in Node 6

* update @types/node to fix TypeScript check step

* lint

* make sure we keep polling regardless of whether we got new data

* use launchdarkly-eventsource, make stream retry behavior consistent

* stream retry delay option should be in seconds & should be included in diagnostics

* minor test fix

* fix: Throw an error on malformed user-supplied logger

* don't call unref() on Redis client; ensure that database integration tests close the store

* update Redis driver to major version 3

* add test case

* allow redisOpts parameter to be omitted

* add logger adapter shim + tests

* minor cleanup and comments for ch74741 fix (logger wrapper)

* fix proxy tunnel configuration and make sure it's used in streaming

* change some string concatenation expressions to use interpolation

* feat: upgrade winston (#189)

* fix merge

* remove support for indirect/patch and indirect/put (#182)

* reuse same Promise and same event listeners for all waitForInitialization calls

* better docs for waitForInitialization + misc doc cleanup (#184)

* update js-eventsource to 1.3.1 for stream parsing bugfix (#185)

* fix broken logger format (#186)

* retroactively update changelog for bugfix in 5.13.2 release

* allow get/getAll Redis queries to be queued if Redis client hasn't yet connected

* set stream read timeout

* adding the alias functionality (#190)

* Removed the guides link

* remove monkey-patching of setImmediate

* Persist contextKind property during feature and custom event transformations (#194)

* add inlineUsersInEvents option in TypeScript

* Add support for seed to bucketUser

* Add note for incorporating seed into evaluation

* Send events when the evaluation is from an experiment

* Use seed to evaluate.

* Clean up test descriptions

* Rename variable to be less confusing

* Use ternary to eliminate mutation

* Make return signature more consistent

* Un-prettier the tests

* redis lower bounds bump (#199)

* update launchdarkly-js-test-helpers to fix TLS tests (#200)

* update js-eventsource to remove vulnerability warning (#201)

* add CI jobs for all compatible Node versions

* CI fixes

* more CI fixes

* comment

* use default value to simplify config

* (6.0 - #1) stop saying we're compatible with Node <12 (#203)

* add CI jobs for all compatible Node versions (#202)

* (6.0 - #2) remove Redis integration (#204)

* allow feature store to be specified as a factory (so it can get our logger)

* (6.0 - #3) remove Winston (#205)

* remove deprecated things for 6.0 (#206)

* update node-cache to 5.x (drops old Node compat)

* update semver to 7.x (drops old Node compat)

* update uuid to 8.x (Node compat, perf improvements, bugfixes)

* update dev dependencies

* linter

* replace lrucache package with lru-cache (#209)

* make yaml dependency optional (#210)

* update release metadata to include maintenance branch

* remove package-lock.json (#211)

* rm prerelease changelog

* (big segments #1) add interfaces for big segments (#212)

* (big segments #2) add all components for big segments except evaluation (#213)

* (big segments #3) implement big segments in flag evaluation (#214)

* (big segments #4) add standard test suite for big segment store tests + refactor feature store tests (#215)

* move new interfaces to a module instead of a namespace (#216)

* fix TS export of CachingStoreWrapper

* use Releaser v2 config

* fix overly specific test expectation that breaks in Node 17

* Initial work on FlagBuilder (#219)

* Add TestData factory(with some dummy methods); Initial work on FlagBuilder

* fixed indentation and linter errors; fixed an error in update; fixed incorrect test label

* fixed typo in TestData store

* converted boolean variation constants to be file variables instead of class variables

Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>

* implemented FlagRuleBuilder; added .build() methods to FlagBuilder/FlagRuleBuilder and changed tests to avoid using private interface

* converted _targets to be Map instead of object literal; changed variationForBoolean to be a module-scoped function instead class-scoped

* Implement stream processor(data source) interface for test data

* Add TestData to index.js and write out the types for TestData and friends

* added testdata documentation to index.d.ts; fix linter errors; changed flag default behavior to create boolean flag

* Fix the interface file: reindented to 2 spaces, corrected definition of functions from properties to functions in interfaces; corrected issues in JSDoc comments

* modify tests to fix capitalization and actually test the test datasource works as an LDClient updateProcessor.

* Fix linter error on defaulted callback

* explicitly enable JSDOM types in TypeScript build to avoid errors when jsdom is referenced for some reason

* capitalize Big Segments in docs & logs

* documentation comment fixes for TestData

* pin TypeScript to 4.4.x

* move TestData and FIleDataSource to integrations module

* lint

* rename types used by TestData for clarity (#229)

* use varargs semantics for TestFlagBuilder.variations() and add it to the TS interface (#230)

* don't ever use for...in (#232)

* don't ever use for...in

* add null guard

* bump launchdarkly-eventsource dependency for sc-136154 fix

* use TestData in our own tests (#231)

* use TestData in our own tests

* update TS interface

* lint

* typo

* fix allFlagsState behavior regarding experimentation

* lint

* allow "secondary" to be referenced in clauses

* don't throw an exception for non-string in semver comparison

* correctly handle "client not ready" condition in allFlagsState

* lint

Co-authored-by: Eli Bishop <[email protected]>
Co-authored-by: LaunchDarklyCI <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Maxwell Gerber <[email protected]>
Co-authored-by: Chris West <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Mike Zorn <[email protected]>
Co-authored-by: Robert J. Neal <[email protected]>
Co-authored-by: Ben Levy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: LaunchDarklyReleaseBot <[email protected]>
LaunchDarklyReleaseBot added a commit that referenced this issue Mar 10, 2022
* rm nock

* Node 6 compatibility

* remove redundant helper, misc cleanup

* Node 6 compatibility

* fix comment

* change asyncify to promisifySingle

* misc fixes

* add Windows CircleCI job

* fix config

* syntax

* diagnostic events, part 2: initial event and stats, except for stream inits

* comments

* add test for stats event

* capture stream connection stats in diagnostic events

* fix test

* remove eventReportingDisabled from diagnostic event; only create diagnosticsManager if needed

* revise tests to use new helper package

* misc cleanup

* use launchdarkly-js-test-helpers 1.0.0

* fix package reference

* minor fixes to config validation messages + add comment

* diagnostic eventsInQueue counter should be # of events at last flush

* rename eventsInQueue to eventsInLastBatch

* don't let user fall outside of last bucket in rollout

* add unit tests for basic bucketing logic and edge case

* avoid redundant property lookups

* fix Redis client parameter to match TS declaration (but still support old incorrect parameter)

* add event payload ID

* remove mistakenly checked-in test code (note, this SDK key was only valid on staging)

* add mention of singleton usage

* update diagnostic event info for OS name, data store type, Node version

* standardize linting

* disallow window and document

* fix null/undef checks

* misc linting fixes

* inlineUsersInEvents is not an unknown option

* drop node-sha1 dependency

* don't omit streamInits.failed when it's false

* bump request dependency to get security patch; loosen some exact dependencies

* remove request package; improve polling cache logic + add test

* bump typescript version to fix build error in Node 6

* update @types/node to fix TypeScript check step

* lint

* make sure we keep polling regardless of whether we got new data

* use launchdarkly-eventsource, make stream retry behavior consistent

* stream retry delay option should be in seconds & should be included in diagnostics

* minor test fix

* fix: Throw an error on malformed user-supplied logger

* don't call unref() on Redis client; ensure that database integration tests close the store

* update Redis driver to major version 3

* add test case

* allow redisOpts parameter to be omitted

* add logger adapter shim + tests

* minor cleanup and comments for ch74741 fix (logger wrapper)

* fix proxy tunnel configuration and make sure it's used in streaming

* change some string concatenation expressions to use interpolation

* feat: upgrade winston (#189)

* fix merge

* remove support for indirect/patch and indirect/put (#182)

* reuse same Promise and same event listeners for all waitForInitialization calls

* better docs for waitForInitialization + misc doc cleanup (#184)

* update js-eventsource to 1.3.1 for stream parsing bugfix (#185)

* fix broken logger format (#186)

* retroactively update changelog for bugfix in 5.13.2 release

* allow get/getAll Redis queries to be queued if Redis client hasn't yet connected

* set stream read timeout

* adding the alias functionality (#190)

* Removed the guides link

* remove monkey-patching of setImmediate

* Persist contextKind property during feature and custom event transformations (#194)

* add inlineUsersInEvents option in TypeScript

* Add support for seed to bucketUser

* Add note for incorporating seed into evaluation

* Send events when the evaluation is from an experiment

* Use seed to evaluate.

* Clean up test descriptions

* Rename variable to be less confusing

* Use ternary to eliminate mutation

* Make return signature more consistent

* Un-prettier the tests

* redis lower bounds bump (#199)

* update launchdarkly-js-test-helpers to fix TLS tests (#200)

* update js-eventsource to remove vulnerability warning (#201)

* add CI jobs for all compatible Node versions

* CI fixes

* more CI fixes

* comment

* use default value to simplify config

* (6.0 - #1) stop saying we're compatible with Node <12 (#203)

* add CI jobs for all compatible Node versions (#202)

* (6.0 - #2) remove Redis integration (#204)

* allow feature store to be specified as a factory (so it can get our logger)

* (6.0 - #3) remove Winston (#205)

* remove deprecated things for 6.0 (#206)

* update node-cache to 5.x (drops old Node compat)

* update semver to 7.x (drops old Node compat)

* update uuid to 8.x (Node compat, perf improvements, bugfixes)

* update dev dependencies

* linter

* replace lrucache package with lru-cache (#209)

* make yaml dependency optional (#210)

* update release metadata to include maintenance branch

* remove package-lock.json (#211)

* rm prerelease changelog

* (big segments #1) add interfaces for big segments (#212)

* (big segments #2) add all components for big segments except evaluation (#213)

* (big segments #3) implement big segments in flag evaluation (#214)

* (big segments #4) add standard test suite for big segment store tests + refactor feature store tests (#215)

* move new interfaces to a module instead of a namespace (#216)

* fix TS export of CachingStoreWrapper

* use Releaser v2 config

* fix overly specific test expectation that breaks in Node 17

* Initial work on FlagBuilder (#219)

* Add TestData factory(with some dummy methods); Initial work on FlagBuilder

* fixed indentation and linter errors; fixed an error in update; fixed incorrect test label

* fixed typo in TestData store

* converted boolean variation constants to be file variables instead of class variables

Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>

* implemented FlagRuleBuilder; added .build() methods to FlagBuilder/FlagRuleBuilder and changed tests to avoid using private interface

* converted _targets to be Map instead of object literal; changed variationForBoolean to be a module-scoped function instead class-scoped

* Implement stream processor(data source) interface for test data

* Add TestData to index.js and write out the types for TestData and friends

* added testdata documentation to index.d.ts; fix linter errors; changed flag default behavior to create boolean flag

* Fix the interface file: reindented to 2 spaces, corrected definition of functions from properties to functions in interfaces; corrected issues in JSDoc comments

* modify tests to fix capitalization and actually test the test datasource works as an LDClient updateProcessor.

* Fix linter error on defaulted callback

* explicitly enable JSDOM types in TypeScript build to avoid errors when jsdom is referenced for some reason

* capitalize Big Segments in docs & logs

* documentation comment fixes for TestData

* pin TypeScript to 4.4.x

* move TestData and FIleDataSource to integrations module

* lint

* rename types used by TestData for clarity (#229)

* use varargs semantics for TestFlagBuilder.variations() and add it to the TS interface (#230)

* don't ever use for...in (#232)

* don't ever use for...in

* add null guard

* bump launchdarkly-eventsource dependency for sc-136154 fix

* use TestData in our own tests (#231)

* use TestData in our own tests

* update TS interface

* lint

* typo

* fix allFlagsState behavior regarding experimentation

* lint

* allow "secondary" to be referenced in clauses

* don't throw an exception for non-string in semver comparison

* correctly handle "client not ready" condition in allFlagsState

* lint

* Flags with a version of 0 reported as 'unknown' in summary events. (#239)

* implement contract test service, not including big segments (#242)

Co-authored-by: Eli Bishop <[email protected]>

* Implement Application tags for the node SDK. (#241)

* update js-eventsource to 1.4.4 for security fix

Co-authored-by: Eli Bishop <[email protected]>
Co-authored-by: LaunchDarklyCI <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Maxwell Gerber <[email protected]>
Co-authored-by: Chris West <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Mike Zorn <[email protected]>
Co-authored-by: Robert J. Neal <[email protected]>
Co-authored-by: Ben Levy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: LaunchDarklyReleaseBot <[email protected]>
Co-authored-by: Ryan Lamb <[email protected]>
LaunchDarklyReleaseBot added a commit that referenced this issue Mar 23, 2022
* Node 6 compatibility

* remove redundant helper, misc cleanup

* Node 6 compatibility

* fix comment

* change asyncify to promisifySingle

* misc fixes

* add Windows CircleCI job

* fix config

* syntax

* diagnostic events, part 2: initial event and stats, except for stream inits

* comments

* add test for stats event

* capture stream connection stats in diagnostic events

* fix test

* remove eventReportingDisabled from diagnostic event; only create diagnosticsManager if needed

* revise tests to use new helper package

* misc cleanup

* use launchdarkly-js-test-helpers 1.0.0

* fix package reference

* minor fixes to config validation messages + add comment

* diagnostic eventsInQueue counter should be # of events at last flush

* rename eventsInQueue to eventsInLastBatch

* don't let user fall outside of last bucket in rollout

* add unit tests for basic bucketing logic and edge case

* avoid redundant property lookups

* fix Redis client parameter to match TS declaration (but still support old incorrect parameter)

* add event payload ID

* remove mistakenly checked-in test code (note, this SDK key was only valid on staging)

* add mention of singleton usage

* update diagnostic event info for OS name, data store type, Node version

* standardize linting

* disallow window and document

* fix null/undef checks

* misc linting fixes

* inlineUsersInEvents is not an unknown option

* drop node-sha1 dependency

* don't omit streamInits.failed when it's false

* bump request dependency to get security patch; loosen some exact dependencies

* remove request package; improve polling cache logic + add test

* bump typescript version to fix build error in Node 6

* update @types/node to fix TypeScript check step

* lint

* make sure we keep polling regardless of whether we got new data

* use launchdarkly-eventsource, make stream retry behavior consistent

* stream retry delay option should be in seconds & should be included in diagnostics

* minor test fix

* fix: Throw an error on malformed user-supplied logger

* don't call unref() on Redis client; ensure that database integration tests close the store

* update Redis driver to major version 3

* add test case

* allow redisOpts parameter to be omitted

* add logger adapter shim + tests

* minor cleanup and comments for ch74741 fix (logger wrapper)

* fix proxy tunnel configuration and make sure it's used in streaming

* change some string concatenation expressions to use interpolation

* feat: upgrade winston (#189)

* fix merge

* remove support for indirect/patch and indirect/put (#182)

* reuse same Promise and same event listeners for all waitForInitialization calls

* better docs for waitForInitialization + misc doc cleanup (#184)

* update js-eventsource to 1.3.1 for stream parsing bugfix (#185)

* fix broken logger format (#186)

* retroactively update changelog for bugfix in 5.13.2 release

* allow get/getAll Redis queries to be queued if Redis client hasn't yet connected

* set stream read timeout

* adding the alias functionality (#190)

* Removed the guides link

* remove monkey-patching of setImmediate

* Persist contextKind property during feature and custom event transformations (#194)

* add inlineUsersInEvents option in TypeScript

* Add support for seed to bucketUser

* Add note for incorporating seed into evaluation

* Send events when the evaluation is from an experiment

* Use seed to evaluate.

* Clean up test descriptions

* Rename variable to be less confusing

* Use ternary to eliminate mutation

* Make return signature more consistent

* Un-prettier the tests

* redis lower bounds bump (#199)

* update launchdarkly-js-test-helpers to fix TLS tests (#200)

* update js-eventsource to remove vulnerability warning (#201)

* add CI jobs for all compatible Node versions

* CI fixes

* more CI fixes

* comment

* use default value to simplify config

* (6.0 - #1) stop saying we're compatible with Node <12 (#203)

* add CI jobs for all compatible Node versions (#202)

* (6.0 - #2) remove Redis integration (#204)

* allow feature store to be specified as a factory (so it can get our logger)

* (6.0 - #3) remove Winston (#205)

* remove deprecated things for 6.0 (#206)

* update node-cache to 5.x (drops old Node compat)

* update semver to 7.x (drops old Node compat)

* update uuid to 8.x (Node compat, perf improvements, bugfixes)

* update dev dependencies

* linter

* replace lrucache package with lru-cache (#209)

* make yaml dependency optional (#210)

* update release metadata to include maintenance branch

* remove package-lock.json (#211)

* rm prerelease changelog

* (big segments #1) add interfaces for big segments (#212)

* (big segments #2) add all components for big segments except evaluation (#213)

* (big segments #3) implement big segments in flag evaluation (#214)

* (big segments #4) add standard test suite for big segment store tests + refactor feature store tests (#215)

* move new interfaces to a module instead of a namespace (#216)

* fix TS export of CachingStoreWrapper

* use Releaser v2 config

* fix overly specific test expectation that breaks in Node 17

* Initial work on FlagBuilder (#219)

* Add TestData factory(with some dummy methods); Initial work on FlagBuilder

* fixed indentation and linter errors; fixed an error in update; fixed incorrect test label

* fixed typo in TestData store

* converted boolean variation constants to be file variables instead of class variables

Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>

* implemented FlagRuleBuilder; added .build() methods to FlagBuilder/FlagRuleBuilder and changed tests to avoid using private interface

* converted _targets to be Map instead of object literal; changed variationForBoolean to be a module-scoped function instead class-scoped

* Implement stream processor(data source) interface for test data

* Add TestData to index.js and write out the types for TestData and friends

* added testdata documentation to index.d.ts; fix linter errors; changed flag default behavior to create boolean flag

* Fix the interface file: reindented to 2 spaces, corrected definition of functions from properties to functions in interfaces; corrected issues in JSDoc comments

* modify tests to fix capitalization and actually test the test datasource works as an LDClient updateProcessor.

* Fix linter error on defaulted callback

* explicitly enable JSDOM types in TypeScript build to avoid errors when jsdom is referenced for some reason

* capitalize Big Segments in docs & logs

* documentation comment fixes for TestData

* pin TypeScript to 4.4.x

* move TestData and FIleDataSource to integrations module

* lint

* rename types used by TestData for clarity (#229)

* use varargs semantics for TestFlagBuilder.variations() and add it to the TS interface (#230)

* don't ever use for...in (#232)

* don't ever use for...in

* add null guard

* bump launchdarkly-eventsource dependency for sc-136154 fix

* use TestData in our own tests (#231)

* use TestData in our own tests

* update TS interface

* lint

* typo

* fix allFlagsState behavior regarding experimentation

* lint

* allow "secondary" to be referenced in clauses

* don't throw an exception for non-string in semver comparison

* correctly handle "client not ready" condition in allFlagsState

* lint

* Flags with a version of 0 reported as 'unknown' in summary events. (#239)

* implement contract test service, not including big segments (#242)

Co-authored-by: Eli Bishop <[email protected]>

* Implement Application tags for the node SDK. (#241)

* update js-eventsource to 1.4.4 for security fix

Co-authored-by: Eli Bishop <[email protected]>
Co-authored-by: LaunchDarklyCI <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Maxwell Gerber <[email protected]>
Co-authored-by: Chris West <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Mike Zorn <[email protected]>
Co-authored-by: Robert J. Neal <[email protected]>
Co-authored-by: Ben Levy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: LaunchDarklyReleaseBot <[email protected]>
Co-authored-by: Ryan Lamb <[email protected]>
eli-darkly added a commit that referenced this issue Mar 28, 2022
* fix sending of update events on stream put

* misc fixes in polling

* add TLS tests

* TS fix

* support metric value in track()

* update method description

* don't fail test if there's one extra file reload

* add unit tests for polling and requestor

* apparently we can't use ES6 imports in this code although they worked for me locally

* add ability to skip Redis tests

* doc updates + build improvements

* fix repo name

* update package name + fix some test stuff

* Bump to a slightly newer version of 'request' to resolve a security vulnerability with 'extend' (#140)

* bump request to resolve a security vulnerability with extend

* remove incorrect build step

* update language

* restore dependency change overwritten by merge

* Adding a note to reference the client-side sdk, plus fixing name inconsistencies (#141)

* update doc comment for track() with metricValue

* fix merge error (obsolete code)

* fix ruleIndex in rule match reason

* reimplement flag change events to use dependency graph

* rm unused

* fix setting of empty dependencies

* misc cleanup

* typo

* update syntax: const, let, arrow functions

* more syntax fixes, linting

* more syntax fixes, linting

* more syntax fixes, linting

* downgrade ESLint because we must support Node 6

* skip update event logic if there are no update event listeners

* consequence of passing an empty object was correct but non-self-evident

* rm meaningless "arguments"

* avoid unnecessary deferral of internal callbacks

* better handling of invalid data types

* fix regex, add comment

* don't signal init failure & don't fire an error unless it's unrecoverable

* fix tests

* remove unused "hoek" dependency

* remove typedoc dependency

* use semver 6.x

* update eslint to 6.x

* update async package (removes old lodash dependency)

* update node-cache package (removes old lodash dependency)

* add audit script

* Revert "update node-cache package (removes old lodash dependency)"

This reverts commit 7d8d074.

* Revert "update async package (removes old lodash dependency)"

This reverts commit 587b777.

* fix dependency path parsing

* Revert "Revert "update async package (removes old lodash dependency)""

This reverts commit 6af73a8.

* Revert "Revert "update node-cache package (removes old lodash dependency)""

This reverts commit 81c3aad.

* run "npm audit fix" for dev dependencies

* update eslint to 6.x (#152)

* update eslint to 6.x

* use CircleCI 2.1 syntax

* typo

* rm unused

* minor cleanup

* syntax fix

* add job names

* add TS decl for new Redis parameter

* add TS syntax check code

* better config validation

* rm unused

* new config options and headers for diagnostic events

* fix tests

* object shorthand

* add more end-to-end tests, improve HTTP test helpers, general cleanup

* rm nock

* Node 6 compatibility

* remove redundant helper, misc cleanup

* Node 6 compatibility

* fix comment

* change asyncify to promisifySingle

* misc fixes

* add Windows CircleCI job

* fix config

* syntax

* diagnostic events, part 2: initial event and stats, except for stream inits

* comments

* add test for stats event

* capture stream connection stats in diagnostic events

* fix test

* remove eventReportingDisabled from diagnostic event; only create diagnosticsManager if needed

* revise tests to use new helper package

* misc cleanup

* use launchdarkly-js-test-helpers 1.0.0

* fix package reference

* minor fixes to config validation messages + add comment

* diagnostic eventsInQueue counter should be # of events at last flush

* rename eventsInQueue to eventsInLastBatch

* don't let user fall outside of last bucket in rollout

* add unit tests for basic bucketing logic and edge case

* avoid redundant property lookups

* fix Redis client parameter to match TS declaration (but still support old incorrect parameter)

* add event payload ID

* remove mistakenly checked-in test code (note, this SDK key was only valid on staging)

* add mention of singleton usage

* update diagnostic event info for OS name, data store type, Node version

* standardize linting

* disallow window and document

* fix null/undef checks

* misc linting fixes

* inlineUsersInEvents is not an unknown option

* drop node-sha1 dependency

* don't omit streamInits.failed when it's false

* bump request dependency to get security patch; loosen some exact dependencies

* remove request package; improve polling cache logic + add test

* bump typescript version to fix build error in Node 6

* update @types/node to fix TypeScript check step

* lint

* make sure we keep polling regardless of whether we got new data

* use launchdarkly-eventsource, make stream retry behavior consistent

* stream retry delay option should be in seconds & should be included in diagnostics

* minor test fix

* fix: Throw an error on malformed user-supplied logger

* don't call unref() on Redis client; ensure that database integration tests close the store

* update Redis driver to major version 3

* add test case

* allow redisOpts parameter to be omitted

* add logger adapter shim + tests

* minor cleanup and comments for ch74741 fix (logger wrapper)

* fix proxy tunnel configuration and make sure it's used in streaming

* change some string concatenation expressions to use interpolation

* feat: upgrade winston (#189)

* fix merge

* remove support for indirect/patch and indirect/put (#182)

* reuse same Promise and same event listeners for all waitForInitialization calls

* better docs for waitForInitialization + misc doc cleanup (#184)

* update js-eventsource to 1.3.1 for stream parsing bugfix (#185)

* fix broken logger format (#186)

* retroactively update changelog for bugfix in 5.13.2 release

* allow get/getAll Redis queries to be queued if Redis client hasn't yet connected

* set stream read timeout

* adding the alias functionality (#190)

* Removed the guides link

* remove monkey-patching of setImmediate

* Persist contextKind property during feature and custom event transformations (#194)

* add inlineUsersInEvents option in TypeScript

* redis lower bounds bump (#199)

* update launchdarkly-js-test-helpers to fix TLS tests (#200)

* update js-eventsource to remove vulnerability warning (#201)

* add CI jobs for all compatible Node versions (#202)

* update release metadata to include maintenance branch

* remove package-lock.json

* adjust test expectation about error message to work in recent Node versions

Co-authored-by: Eli Bishop <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: LaunchDarklyCI <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Maxwell Gerber <[email protected]>
Co-authored-by: Chris West <[email protected]>
LaunchDarklyReleaseBot added a commit that referenced this issue Apr 26, 2022
* comments

* add test for stats event

* capture stream connection stats in diagnostic events

* fix test

* remove eventReportingDisabled from diagnostic event; only create diagnosticsManager if needed

* revise tests to use new helper package

* misc cleanup

* use launchdarkly-js-test-helpers 1.0.0

* fix package reference

* minor fixes to config validation messages + add comment

* diagnostic eventsInQueue counter should be # of events at last flush

* rename eventsInQueue to eventsInLastBatch

* don't let user fall outside of last bucket in rollout

* add unit tests for basic bucketing logic and edge case

* avoid redundant property lookups

* fix Redis client parameter to match TS declaration (but still support old incorrect parameter)

* add event payload ID

* remove mistakenly checked-in test code (note, this SDK key was only valid on staging)

* add mention of singleton usage

* update diagnostic event info for OS name, data store type, Node version

* standardize linting

* disallow window and document

* fix null/undef checks

* misc linting fixes

* inlineUsersInEvents is not an unknown option

* drop node-sha1 dependency

* don't omit streamInits.failed when it's false

* bump request dependency to get security patch; loosen some exact dependencies

* remove request package; improve polling cache logic + add test

* bump typescript version to fix build error in Node 6

* update @types/node to fix TypeScript check step

* lint

* make sure we keep polling regardless of whether we got new data

* use launchdarkly-eventsource, make stream retry behavior consistent

* stream retry delay option should be in seconds & should be included in diagnostics

* minor test fix

* fix: Throw an error on malformed user-supplied logger

* don't call unref() on Redis client; ensure that database integration tests close the store

* update Redis driver to major version 3

* add test case

* allow redisOpts parameter to be omitted

* add logger adapter shim + tests

* minor cleanup and comments for ch74741 fix (logger wrapper)

* fix proxy tunnel configuration and make sure it's used in streaming

* change some string concatenation expressions to use interpolation

* feat: upgrade winston (#189)

* fix merge

* remove support for indirect/patch and indirect/put (#182)

* reuse same Promise and same event listeners for all waitForInitialization calls

* better docs for waitForInitialization + misc doc cleanup (#184)

* update js-eventsource to 1.3.1 for stream parsing bugfix (#185)

* fix broken logger format (#186)

* retroactively update changelog for bugfix in 5.13.2 release

* allow get/getAll Redis queries to be queued if Redis client hasn't yet connected

* set stream read timeout

* adding the alias functionality (#190)

* Removed the guides link

* remove monkey-patching of setImmediate

* Persist contextKind property during feature and custom event transformations (#194)

* add inlineUsersInEvents option in TypeScript

* Add support for seed to bucketUser

* Add note for incorporating seed into evaluation

* Send events when the evaluation is from an experiment

* Use seed to evaluate.

* Clean up test descriptions

* Rename variable to be less confusing

* Use ternary to eliminate mutation

* Make return signature more consistent

* Un-prettier the tests

* redis lower bounds bump (#199)

* update launchdarkly-js-test-helpers to fix TLS tests (#200)

* update js-eventsource to remove vulnerability warning (#201)

* add CI jobs for all compatible Node versions

* CI fixes

* more CI fixes

* comment

* use default value to simplify config

* (6.0 - #1) stop saying we're compatible with Node <12 (#203)

* add CI jobs for all compatible Node versions (#202)

* (6.0 - #2) remove Redis integration (#204)

* allow feature store to be specified as a factory (so it can get our logger)

* (6.0 - #3) remove Winston (#205)

* remove deprecated things for 6.0 (#206)

* update node-cache to 5.x (drops old Node compat)

* update semver to 7.x (drops old Node compat)

* update uuid to 8.x (Node compat, perf improvements, bugfixes)

* update dev dependencies

* linter

* replace lrucache package with lru-cache (#209)

* make yaml dependency optional (#210)

* update release metadata to include maintenance branch

* remove package-lock.json (#211)

* rm prerelease changelog

* (big segments #1) add interfaces for big segments (#212)

* (big segments #2) add all components for big segments except evaluation (#213)

* (big segments #3) implement big segments in flag evaluation (#214)

* (big segments #4) add standard test suite for big segment store tests + refactor feature store tests (#215)

* move new interfaces to a module instead of a namespace (#216)

* fix TS export of CachingStoreWrapper

* use Releaser v2 config

* fix overly specific test expectation that breaks in Node 17

* Initial work on FlagBuilder (#219)

* Add TestData factory(with some dummy methods); Initial work on FlagBuilder

* fixed indentation and linter errors; fixed an error in update; fixed incorrect test label

* fixed typo in TestData store

* converted boolean variation constants to be file variables instead of class variables

Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>

* implemented FlagRuleBuilder; added .build() methods to FlagBuilder/FlagRuleBuilder and changed tests to avoid using private interface

* converted _targets to be Map instead of object literal; changed variationForBoolean to be a module-scoped function instead class-scoped

* Implement stream processor(data source) interface for test data

* Add TestData to index.js and write out the types for TestData and friends

* added testdata documentation to index.d.ts; fix linter errors; changed flag default behavior to create boolean flag

* Fix the interface file: reindented to 2 spaces, corrected definition of functions from properties to functions in interfaces; corrected issues in JSDoc comments

* modify tests to fix capitalization and actually test the test datasource works as an LDClient updateProcessor.

* Fix linter error on defaulted callback

* explicitly enable JSDOM types in TypeScript build to avoid errors when jsdom is referenced for some reason

* capitalize Big Segments in docs & logs

* documentation comment fixes for TestData

* pin TypeScript to 4.4.x

* move TestData and FIleDataSource to integrations module

* lint

* rename types used by TestData for clarity (#229)

* use varargs semantics for TestFlagBuilder.variations() and add it to the TS interface (#230)

* don't ever use for...in (#232)

* don't ever use for...in

* add null guard

* bump launchdarkly-eventsource dependency for sc-136154 fix

* use TestData in our own tests (#231)

* use TestData in our own tests

* update TS interface

* lint

* typo

* fix allFlagsState behavior regarding experimentation

* lint

* allow "secondary" to be referenced in clauses

* don't throw an exception for non-string in semver comparison

* correctly handle "client not ready" condition in allFlagsState

* lint

* Flags with a version of 0 reported as 'unknown' in summary events. (#239)

* implement contract test service, not including big segments (#242)

Co-authored-by: Eli Bishop <[email protected]>

* Implement Application tags for the node SDK. (#241)

* update js-eventsource to 1.4.4 for security fix

* remove package-lock.json

* adjust test expectation about error message to work in recent Node versions

* Adds link to Relay Proxy docs

* Update index.d.ts

Co-authored-by: Eli Bishop <[email protected]>

* ensure setTimeout task is cleared when polling is stopped

* fix some flaky tests using async blocking logic

* rm unused

* simplify polling implementation using setInterval

Co-authored-by: Eli Bishop <[email protected]>
Co-authored-by: LaunchDarklyCI <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Maxwell Gerber <[email protected]>
Co-authored-by: Chris West <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Mike Zorn <[email protected]>
Co-authored-by: Robert J. Neal <[email protected]>
Co-authored-by: Ben Levy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: LaunchDarklyReleaseBot <[email protected]>
Co-authored-by: Ryan Lamb <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
LaunchDarklyReleaseBot added a commit that referenced this issue Jun 6, 2022
* revise tests to use new helper package

* misc cleanup

* use launchdarkly-js-test-helpers 1.0.0

* fix package reference

* minor fixes to config validation messages + add comment

* diagnostic eventsInQueue counter should be # of events at last flush

* rename eventsInQueue to eventsInLastBatch

* don't let user fall outside of last bucket in rollout

* add unit tests for basic bucketing logic and edge case

* avoid redundant property lookups

* fix Redis client parameter to match TS declaration (but still support old incorrect parameter)

* add event payload ID

* remove mistakenly checked-in test code (note, this SDK key was only valid on staging)

* add mention of singleton usage

* update diagnostic event info for OS name, data store type, Node version

* standardize linting

* disallow window and document

* fix null/undef checks

* misc linting fixes

* inlineUsersInEvents is not an unknown option

* drop node-sha1 dependency

* don't omit streamInits.failed when it's false

* bump request dependency to get security patch; loosen some exact dependencies

* remove request package; improve polling cache logic + add test

* bump typescript version to fix build error in Node 6

* update @types/node to fix TypeScript check step

* lint

* make sure we keep polling regardless of whether we got new data

* use launchdarkly-eventsource, make stream retry behavior consistent

* stream retry delay option should be in seconds & should be included in diagnostics

* minor test fix

* fix: Throw an error on malformed user-supplied logger

* don't call unref() on Redis client; ensure that database integration tests close the store

* update Redis driver to major version 3

* add test case

* allow redisOpts parameter to be omitted

* add logger adapter shim + tests

* minor cleanup and comments for ch74741 fix (logger wrapper)

* fix proxy tunnel configuration and make sure it's used in streaming

* change some string concatenation expressions to use interpolation

* feat: upgrade winston (#189)

* fix merge

* remove support for indirect/patch and indirect/put (#182)

* reuse same Promise and same event listeners for all waitForInitialization calls

* better docs for waitForInitialization + misc doc cleanup (#184)

* update js-eventsource to 1.3.1 for stream parsing bugfix (#185)

* fix broken logger format (#186)

* retroactively update changelog for bugfix in 5.13.2 release

* allow get/getAll Redis queries to be queued if Redis client hasn't yet connected

* set stream read timeout

* adding the alias functionality (#190)

* Removed the guides link

* remove monkey-patching of setImmediate

* Persist contextKind property during feature and custom event transformations (#194)

* add inlineUsersInEvents option in TypeScript

* Add support for seed to bucketUser

* Add note for incorporating seed into evaluation

* Send events when the evaluation is from an experiment

* Use seed to evaluate.

* Clean up test descriptions

* Rename variable to be less confusing

* Use ternary to eliminate mutation

* Make return signature more consistent

* Un-prettier the tests

* redis lower bounds bump (#199)

* update launchdarkly-js-test-helpers to fix TLS tests (#200)

* update js-eventsource to remove vulnerability warning (#201)

* add CI jobs for all compatible Node versions

* CI fixes

* more CI fixes

* comment

* use default value to simplify config

* (6.0 - #1) stop saying we're compatible with Node <12 (#203)

* add CI jobs for all compatible Node versions (#202)

* (6.0 - #2) remove Redis integration (#204)

* allow feature store to be specified as a factory (so it can get our logger)

* (6.0 - #3) remove Winston (#205)

* remove deprecated things for 6.0 (#206)

* update node-cache to 5.x (drops old Node compat)

* update semver to 7.x (drops old Node compat)

* update uuid to 8.x (Node compat, perf improvements, bugfixes)

* update dev dependencies

* linter

* replace lrucache package with lru-cache (#209)

* make yaml dependency optional (#210)

* update release metadata to include maintenance branch

* remove package-lock.json (#211)

* rm prerelease changelog

* (big segments #1) add interfaces for big segments (#212)

* (big segments #2) add all components for big segments except evaluation (#213)

* (big segments #3) implement big segments in flag evaluation (#214)

* (big segments #4) add standard test suite for big segment store tests + refactor feature store tests (#215)

* move new interfaces to a module instead of a namespace (#216)

* fix TS export of CachingStoreWrapper

* use Releaser v2 config

* fix overly specific test expectation that breaks in Node 17

* Initial work on FlagBuilder (#219)

* Add TestData factory(with some dummy methods); Initial work on FlagBuilder

* fixed indentation and linter errors; fixed an error in update; fixed incorrect test label

* fixed typo in TestData store

* converted boolean variation constants to be file variables instead of class variables

Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>

* implemented FlagRuleBuilder; added .build() methods to FlagBuilder/FlagRuleBuilder and changed tests to avoid using private interface

* converted _targets to be Map instead of object literal; changed variationForBoolean to be a module-scoped function instead class-scoped

* Implement stream processor(data source) interface for test data

* Add TestData to index.js and write out the types for TestData and friends

* added testdata documentation to index.d.ts; fix linter errors; changed flag default behavior to create boolean flag

* Fix the interface file: reindented to 2 spaces, corrected definition of functions from properties to functions in interfaces; corrected issues in JSDoc comments

* modify tests to fix capitalization and actually test the test datasource works as an LDClient updateProcessor.

* Fix linter error on defaulted callback

* explicitly enable JSDOM types in TypeScript build to avoid errors when jsdom is referenced for some reason

* capitalize Big Segments in docs & logs

* documentation comment fixes for TestData

* pin TypeScript to 4.4.x

* move TestData and FIleDataSource to integrations module

* lint

* rename types used by TestData for clarity (#229)

* use varargs semantics for TestFlagBuilder.variations() and add it to the TS interface (#230)

* don't ever use for...in (#232)

* don't ever use for...in

* add null guard

* bump launchdarkly-eventsource dependency for sc-136154 fix

* use TestData in our own tests (#231)

* use TestData in our own tests

* update TS interface

* lint

* typo

* fix allFlagsState behavior regarding experimentation

* lint

* allow "secondary" to be referenced in clauses

* don't throw an exception for non-string in semver comparison

* correctly handle "client not ready" condition in allFlagsState

* lint

* Flags with a version of 0 reported as 'unknown' in summary events. (#239)

* implement contract test service, not including big segments (#242)

Co-authored-by: Eli Bishop <[email protected]>

* Implement Application tags for the node SDK. (#241)

* update js-eventsource to 1.4.4 for security fix

* remove package-lock.json

* adjust test expectation about error message to work in recent Node versions

* Adds link to Relay Proxy docs

* Update index.d.ts

Co-authored-by: Eli Bishop <[email protected]>

* ensure setTimeout task is cleared when polling is stopped

* fix some flaky tests using async blocking logic

* rm unused

* simplify polling implementation using setInterval

* use newer js-test-helpers for async tests

* add request number to timeout message

* Enforce 64 character limit for application tag values. (#263)

Co-authored-by: Eli Bishop <[email protected]>
Co-authored-by: LaunchDarklyCI <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Maxwell Gerber <[email protected]>
Co-authored-by: Chris West <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Mike Zorn <[email protected]>
Co-authored-by: Robert J. Neal <[email protected]>
Co-authored-by: Ben Levy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: LaunchDarklyReleaseBot <[email protected]>
Co-authored-by: Ryan Lamb <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
LaunchDarklyReleaseBot added a commit that referenced this issue Sep 6, 2022
* revise tests to use new helper package

* misc cleanup

* use launchdarkly-js-test-helpers 1.0.0

* fix package reference

* minor fixes to config validation messages + add comment

* diagnostic eventsInQueue counter should be # of events at last flush

* rename eventsInQueue to eventsInLastBatch

* don't let user fall outside of last bucket in rollout

* add unit tests for basic bucketing logic and edge case

* avoid redundant property lookups

* fix Redis client parameter to match TS declaration (but still support old incorrect parameter)

* add event payload ID

* remove mistakenly checked-in test code (note, this SDK key was only valid on staging)

* add mention of singleton usage

* update diagnostic event info for OS name, data store type, Node version

* standardize linting

* disallow window and document

* fix null/undef checks

* misc linting fixes

* inlineUsersInEvents is not an unknown option

* drop node-sha1 dependency

* don't omit streamInits.failed when it's false

* bump request dependency to get security patch; loosen some exact dependencies

* remove request package; improve polling cache logic + add test

* bump typescript version to fix build error in Node 6

* update @types/node to fix TypeScript check step

* lint

* make sure we keep polling regardless of whether we got new data

* use launchdarkly-eventsource, make stream retry behavior consistent

* stream retry delay option should be in seconds & should be included in diagnostics

* minor test fix

* fix: Throw an error on malformed user-supplied logger

* don't call unref() on Redis client; ensure that database integration tests close the store

* update Redis driver to major version 3

* add test case

* allow redisOpts parameter to be omitted

* add logger adapter shim + tests

* minor cleanup and comments for ch74741 fix (logger wrapper)

* fix proxy tunnel configuration and make sure it's used in streaming

* change some string concatenation expressions to use interpolation

* feat: upgrade winston (#189)

* fix merge

* remove support for indirect/patch and indirect/put (#182)

* reuse same Promise and same event listeners for all waitForInitialization calls

* better docs for waitForInitialization + misc doc cleanup (#184)

* update js-eventsource to 1.3.1 for stream parsing bugfix (#185)

* fix broken logger format (#186)

* retroactively update changelog for bugfix in 5.13.2 release

* allow get/getAll Redis queries to be queued if Redis client hasn't yet connected

* set stream read timeout

* adding the alias functionality (#190)

* Removed the guides link

* remove monkey-patching of setImmediate

* Persist contextKind property during feature and custom event transformations (#194)

* add inlineUsersInEvents option in TypeScript

* Add support for seed to bucketUser

* Add note for incorporating seed into evaluation

* Send events when the evaluation is from an experiment

* Use seed to evaluate.

* Clean up test descriptions

* Rename variable to be less confusing

* Use ternary to eliminate mutation

* Make return signature more consistent

* Un-prettier the tests

* redis lower bounds bump (#199)

* update launchdarkly-js-test-helpers to fix TLS tests (#200)

* update js-eventsource to remove vulnerability warning (#201)

* add CI jobs for all compatible Node versions

* CI fixes

* more CI fixes

* comment

* use default value to simplify config

* (6.0 - #1) stop saying we're compatible with Node <12 (#203)

* add CI jobs for all compatible Node versions (#202)

* (6.0 - #2) remove Redis integration (#204)

* allow feature store to be specified as a factory (so it can get our logger)

* (6.0 - #3) remove Winston (#205)

* remove deprecated things for 6.0 (#206)

* update node-cache to 5.x (drops old Node compat)

* update semver to 7.x (drops old Node compat)

* update uuid to 8.x (Node compat, perf improvements, bugfixes)

* update dev dependencies

* linter

* replace lrucache package with lru-cache (#209)

* make yaml dependency optional (#210)

* update release metadata to include maintenance branch

* remove package-lock.json (#211)

* rm prerelease changelog

* (big segments #1) add interfaces for big segments (#212)

* (big segments #2) add all components for big segments except evaluation (#213)

* (big segments #3) implement big segments in flag evaluation (#214)

* (big segments #4) add standard test suite for big segment store tests + refactor feature store tests (#215)

* move new interfaces to a module instead of a namespace (#216)

* fix TS export of CachingStoreWrapper

* use Releaser v2 config

* fix overly specific test expectation that breaks in Node 17

* Initial work on FlagBuilder (#219)

* Add TestData factory(with some dummy methods); Initial work on FlagBuilder

* fixed indentation and linter errors; fixed an error in update; fixed incorrect test label

* fixed typo in TestData store

* converted boolean variation constants to be file variables instead of class variables

Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>

* implemented FlagRuleBuilder; added .build() methods to FlagBuilder/FlagRuleBuilder and changed tests to avoid using private interface

* converted _targets to be Map instead of object literal; changed variationForBoolean to be a module-scoped function instead class-scoped

* Implement stream processor(data source) interface for test data

* Add TestData to index.js and write out the types for TestData and friends

* added testdata documentation to index.d.ts; fix linter errors; changed flag default behavior to create boolean flag

* Fix the interface file: reindented to 2 spaces, corrected definition of functions from properties to functions in interfaces; corrected issues in JSDoc comments

* modify tests to fix capitalization and actually test the test datasource works as an LDClient updateProcessor.

* Fix linter error on defaulted callback

* explicitly enable JSDOM types in TypeScript build to avoid errors when jsdom is referenced for some reason

* capitalize Big Segments in docs & logs

* documentation comment fixes for TestData

* pin TypeScript to 4.4.x

* move TestData and FIleDataSource to integrations module

* lint

* rename types used by TestData for clarity (#229)

* use varargs semantics for TestFlagBuilder.variations() and add it to the TS interface (#230)

* don't ever use for...in (#232)

* don't ever use for...in

* add null guard

* bump launchdarkly-eventsource dependency for sc-136154 fix

* use TestData in our own tests (#231)

* use TestData in our own tests

* update TS interface

* lint

* typo

* fix allFlagsState behavior regarding experimentation

* lint

* allow "secondary" to be referenced in clauses

* don't throw an exception for non-string in semver comparison

* correctly handle "client not ready" condition in allFlagsState

* lint

* Flags with a version of 0 reported as 'unknown' in summary events. (#239)

* implement contract test service, not including big segments (#242)

Co-authored-by: Eli Bishop <[email protected]>

* Implement Application tags for the node SDK. (#241)

* update js-eventsource to 1.4.4 for security fix

* remove package-lock.json

* adjust test expectation about error message to work in recent Node versions

* Adds link to Relay Proxy docs

* Update index.d.ts

Co-authored-by: Eli Bishop <[email protected]>

* ensure setTimeout task is cleared when polling is stopped

* fix some flaky tests using async blocking logic

* rm unused

* simplify polling implementation using setInterval

* use newer js-test-helpers for async tests

* add request number to timeout message

* Enforce 64 character limit for application tag values. (#263)

* Fixed operator field key name in TestDataRuleBuilder (#246)

Co-authored-by: Eli Bishop <[email protected]>
Co-authored-by: LaunchDarklyCI <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Maxwell Gerber <[email protected]>
Co-authored-by: Chris West <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Mike Zorn <[email protected]>
Co-authored-by: Robert J. Neal <[email protected]>
Co-authored-by: Ben Levy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: LaunchDarklyReleaseBot <[email protected]>
Co-authored-by: Ryan Lamb <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
LaunchDarklyReleaseBot added a commit that referenced this issue Dec 7, 2022
* add mention of singleton usage

* update diagnostic event info for OS name, data store type, Node version

* standardize linting

* disallow window and document

* fix null/undef checks

* misc linting fixes

* inlineUsersInEvents is not an unknown option

* drop node-sha1 dependency

* don't omit streamInits.failed when it's false

* bump request dependency to get security patch; loosen some exact dependencies

* remove request package; improve polling cache logic + add test

* bump typescript version to fix build error in Node 6

* update @types/node to fix TypeScript check step

* lint

* make sure we keep polling regardless of whether we got new data

* use launchdarkly-eventsource, make stream retry behavior consistent

* stream retry delay option should be in seconds & should be included in diagnostics

* minor test fix

* fix: Throw an error on malformed user-supplied logger

* don't call unref() on Redis client; ensure that database integration tests close the store

* update Redis driver to major version 3

* add test case

* allow redisOpts parameter to be omitted

* add logger adapter shim + tests

* minor cleanup and comments for ch74741 fix (logger wrapper)

* fix proxy tunnel configuration and make sure it's used in streaming

* change some string concatenation expressions to use interpolation

* feat: upgrade winston (#189)

* fix merge

* remove support for indirect/patch and indirect/put (#182)

* reuse same Promise and same event listeners for all waitForInitialization calls

* better docs for waitForInitialization + misc doc cleanup (#184)

* update js-eventsource to 1.3.1 for stream parsing bugfix (#185)

* fix broken logger format (#186)

* retroactively update changelog for bugfix in 5.13.2 release

* allow get/getAll Redis queries to be queued if Redis client hasn't yet connected

* set stream read timeout

* adding the alias functionality (#190)

* Removed the guides link

* remove monkey-patching of setImmediate

* Persist contextKind property during feature and custom event transformations (#194)

* add inlineUsersInEvents option in TypeScript

* Add support for seed to bucketUser

* Add note for incorporating seed into evaluation

* Send events when the evaluation is from an experiment

* Use seed to evaluate.

* Clean up test descriptions

* Rename variable to be less confusing

* Use ternary to eliminate mutation

* Make return signature more consistent

* Un-prettier the tests

* redis lower bounds bump (#199)

* update launchdarkly-js-test-helpers to fix TLS tests (#200)

* update js-eventsource to remove vulnerability warning (#201)

* add CI jobs for all compatible Node versions

* CI fixes

* more CI fixes

* comment

* use default value to simplify config

* (6.0 - #1) stop saying we're compatible with Node <12 (#203)

* add CI jobs for all compatible Node versions (#202)

* (6.0 - #2) remove Redis integration (#204)

* allow feature store to be specified as a factory (so it can get our logger)

* (6.0 - #3) remove Winston (#205)

* remove deprecated things for 6.0 (#206)

* update node-cache to 5.x (drops old Node compat)

* update semver to 7.x (drops old Node compat)

* update uuid to 8.x (Node compat, perf improvements, bugfixes)

* update dev dependencies

* linter

* replace lrucache package with lru-cache (#209)

* make yaml dependency optional (#210)

* update release metadata to include maintenance branch

* remove package-lock.json (#211)

* rm prerelease changelog

* (big segments #1) add interfaces for big segments (#212)

* (big segments #2) add all components for big segments except evaluation (#213)

* (big segments #3) implement big segments in flag evaluation (#214)

* (big segments #4) add standard test suite for big segment store tests + refactor feature store tests (#215)

* move new interfaces to a module instead of a namespace (#216)

* fix TS export of CachingStoreWrapper

* use Releaser v2 config

* fix overly specific test expectation that breaks in Node 17

* Initial work on FlagBuilder (#219)

* Add TestData factory(with some dummy methods); Initial work on FlagBuilder

* fixed indentation and linter errors; fixed an error in update; fixed incorrect test label

* fixed typo in TestData store

* converted boolean variation constants to be file variables instead of class variables

Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>

* implemented FlagRuleBuilder; added .build() methods to FlagBuilder/FlagRuleBuilder and changed tests to avoid using private interface

* converted _targets to be Map instead of object literal; changed variationForBoolean to be a module-scoped function instead class-scoped

* Implement stream processor(data source) interface for test data

* Add TestData to index.js and write out the types for TestData and friends

* added testdata documentation to index.d.ts; fix linter errors; changed flag default behavior to create boolean flag

* Fix the interface file: reindented to 2 spaces, corrected definition of functions from properties to functions in interfaces; corrected issues in JSDoc comments

* modify tests to fix capitalization and actually test the test datasource works as an LDClient updateProcessor.

* Fix linter error on defaulted callback

* explicitly enable JSDOM types in TypeScript build to avoid errors when jsdom is referenced for some reason

* capitalize Big Segments in docs & logs

* documentation comment fixes for TestData

* pin TypeScript to 4.4.x

* move TestData and FIleDataSource to integrations module

* lint

* rename types used by TestData for clarity (#229)

* use varargs semantics for TestFlagBuilder.variations() and add it to the TS interface (#230)

* don't ever use for...in (#232)

* don't ever use for...in

* add null guard

* bump launchdarkly-eventsource dependency for sc-136154 fix

* use TestData in our own tests (#231)

* use TestData in our own tests

* update TS interface

* lint

* typo

* fix allFlagsState behavior regarding experimentation

* lint

* allow "secondary" to be referenced in clauses

* don't throw an exception for non-string in semver comparison

* correctly handle "client not ready" condition in allFlagsState

* lint

* Flags with a version of 0 reported as 'unknown' in summary events. (#239)

* Initial draft of typescript types. (#236)

* Implement attribute reference support.

* implement contract test service, not including big segments (#242)

Co-authored-by: Eli Bishop <[email protected]>

* Implement Application tags for the node SDK. (#241)

* update js-eventsource to 1.4.4 for security fix

* remove package-lock.json

* adjust test expectation about error message to work in recent Node versions

* #3 Add context filtering and legacy to single kind conversion. (#238)

Co-authored-by: Eli Bishop <[email protected]>

* #4 Switch from user to context for events. (#244)

Co-authored-by: Eli Bishop <[email protected]>

* #5 Rlamb/sc 142950/implement u2c evaluation (#248)

Co-authored-by: Eli Bishop <[email protected]>

* #6 Rlamb/sc 145767/attribute reference improvements (#250)

Co-authored-by: Eli Bishop <[email protected]>

* #7 Rlamb/sc 146614/do not support bucketby for experiments (#251)

Co-authored-by: Eli Bishop <[email protected]>

* #8 Rlamb/sc 147263/treat cyclic segements as errors (#252)

Co-authored-by: Eli Bishop <[email protected]>

* Do not use the secondary key for experiments. (#256)

* Resolve issues with V2 test harness. (#258)

* Adds link to Relay Proxy docs

* Update index.d.ts

Co-authored-by: Eli Bishop <[email protected]>

* ensure setTimeout task is cleared when polling is stopped

* fix some flaky tests using async blocking logic

* rm unused

* simplify polling implementation using setInterval

* Update the test data source for U2C. (#257)

* use newer js-test-helpers for async tests

* add request number to timeout message

* Enforce 64 character limit for application tag values. (#263)

* Changed transient back to anonymous. (#264)

* Fixed operator field key name in TestDataRuleBuilder (#246)

* Do not set `inExperiment`  if there is not a context for the specified kind. (#266)

* [sc-160948] Switch to partial URL encoding. (#265)

* Update event schema version. (#267)

* [sc-171125] Do now allow indexing into an array with an attribute reference. (#268)

* [sc-174033] Remove support for secondary. (#269)

* Treat 'kind' and '/kind' the same. (#270)

* [sc-176598] Update node U2C with latest changes from main. (#272)

* [sc-176599] Update documentation for privateAttributes _meta attribute of contexts. (#271)

* Remove copy/paste error. (#274)

* [sc-177983] Add support for executing old style user tests. (#275)

* Update release metadata.

* Do not generate events for bad contexts. (#277)

Co-authored-by: Yusinto Ngadiman <[email protected]>

* Handle nested segment dependencies. (#278)

Co-authored-by: LaunchDarklyCI <[email protected]>
Co-authored-by: Eli Bishop <[email protected]>
Co-authored-by: Maxwell Gerber <[email protected]>
Co-authored-by: Chris West <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Mike Zorn <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Robert J. Neal <[email protected]>
Co-authored-by: Ben Levy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: LaunchDarklyReleaseBot <[email protected]>
Co-authored-by: Ryan Lamb <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
Co-authored-by: Yusinto Ngadiman <[email protected]>
LaunchDarklyReleaseBot added a commit that referenced this issue Feb 8, 2023
* update diagnostic event info for OS name, data store type, Node version

* standardize linting

* disallow window and document

* fix null/undef checks

* misc linting fixes

* inlineUsersInEvents is not an unknown option

* drop node-sha1 dependency

* don't omit streamInits.failed when it's false

* bump request dependency to get security patch; loosen some exact dependencies

* remove request package; improve polling cache logic + add test

* bump typescript version to fix build error in Node 6

* update @types/node to fix TypeScript check step

* lint

* make sure we keep polling regardless of whether we got new data

* use launchdarkly-eventsource, make stream retry behavior consistent

* stream retry delay option should be in seconds & should be included in diagnostics

* minor test fix

* fix: Throw an error on malformed user-supplied logger

* don't call unref() on Redis client; ensure that database integration tests close the store

* update Redis driver to major version 3

* add test case

* allow redisOpts parameter to be omitted

* add logger adapter shim + tests

* minor cleanup and comments for ch74741 fix (logger wrapper)

* fix proxy tunnel configuration and make sure it's used in streaming

* change some string concatenation expressions to use interpolation

* feat: upgrade winston (#189)

* fix merge

* remove support for indirect/patch and indirect/put (#182)

* reuse same Promise and same event listeners for all waitForInitialization calls

* better docs for waitForInitialization + misc doc cleanup (#184)

* update js-eventsource to 1.3.1 for stream parsing bugfix (#185)

* fix broken logger format (#186)

* retroactively update changelog for bugfix in 5.13.2 release

* allow get/getAll Redis queries to be queued if Redis client hasn't yet connected

* set stream read timeout

* adding the alias functionality (#190)

* Removed the guides link

* remove monkey-patching of setImmediate

* Persist contextKind property during feature and custom event transformations (#194)

* add inlineUsersInEvents option in TypeScript

* Add support for seed to bucketUser

* Add note for incorporating seed into evaluation

* Send events when the evaluation is from an experiment

* Use seed to evaluate.

* Clean up test descriptions

* Rename variable to be less confusing

* Use ternary to eliminate mutation

* Make return signature more consistent

* Un-prettier the tests

* redis lower bounds bump (#199)

* update launchdarkly-js-test-helpers to fix TLS tests (#200)

* update js-eventsource to remove vulnerability warning (#201)

* add CI jobs for all compatible Node versions

* CI fixes

* more CI fixes

* comment

* use default value to simplify config

* (6.0 - #1) stop saying we're compatible with Node <12 (#203)

* add CI jobs for all compatible Node versions (#202)

* (6.0 - #2) remove Redis integration (#204)

* allow feature store to be specified as a factory (so it can get our logger)

* (6.0 - #3) remove Winston (#205)

* remove deprecated things for 6.0 (#206)

* update node-cache to 5.x (drops old Node compat)

* update semver to 7.x (drops old Node compat)

* update uuid to 8.x (Node compat, perf improvements, bugfixes)

* update dev dependencies

* linter

* replace lrucache package with lru-cache (#209)

* make yaml dependency optional (#210)

* update release metadata to include maintenance branch

* remove package-lock.json (#211)

* rm prerelease changelog

* (big segments #1) add interfaces for big segments (#212)

* (big segments #2) add all components for big segments except evaluation (#213)

* (big segments #3) implement big segments in flag evaluation (#214)

* (big segments #4) add standard test suite for big segment store tests + refactor feature store tests (#215)

* move new interfaces to a module instead of a namespace (#216)

* fix TS export of CachingStoreWrapper

* use Releaser v2 config

* fix overly specific test expectation that breaks in Node 17

* Initial work on FlagBuilder (#219)

* Add TestData factory(with some dummy methods); Initial work on FlagBuilder

* fixed indentation and linter errors; fixed an error in update; fixed incorrect test label

* fixed typo in TestData store

* converted boolean variation constants to be file variables instead of class variables

Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>

* implemented FlagRuleBuilder; added .build() methods to FlagBuilder/FlagRuleBuilder and changed tests to avoid using private interface

* converted _targets to be Map instead of object literal; changed variationForBoolean to be a module-scoped function instead class-scoped

* Implement stream processor(data source) interface for test data

* Add TestData to index.js and write out the types for TestData and friends

* added testdata documentation to index.d.ts; fix linter errors; changed flag default behavior to create boolean flag

* Fix the interface file: reindented to 2 spaces, corrected definition of functions from properties to functions in interfaces; corrected issues in JSDoc comments

* modify tests to fix capitalization and actually test the test datasource works as an LDClient updateProcessor.

* Fix linter error on defaulted callback

* explicitly enable JSDOM types in TypeScript build to avoid errors when jsdom is referenced for some reason

* capitalize Big Segments in docs & logs

* documentation comment fixes for TestData

* pin TypeScript to 4.4.x

* move TestData and FIleDataSource to integrations module

* lint

* rename types used by TestData for clarity (#229)

* use varargs semantics for TestFlagBuilder.variations() and add it to the TS interface (#230)

* don't ever use for...in (#232)

* don't ever use for...in

* add null guard

* bump launchdarkly-eventsource dependency for sc-136154 fix

* use TestData in our own tests (#231)

* use TestData in our own tests

* update TS interface

* lint

* typo

* fix allFlagsState behavior regarding experimentation

* lint

* allow "secondary" to be referenced in clauses

* don't throw an exception for non-string in semver comparison

* correctly handle "client not ready" condition in allFlagsState

* lint

* Flags with a version of 0 reported as 'unknown' in summary events. (#239)

* Initial draft of typescript types. (#236)

* Implement attribute reference support.

* implement contract test service, not including big segments (#242)

Co-authored-by: Eli Bishop <[email protected]>

* Implement Application tags for the node SDK. (#241)

* update js-eventsource to 1.4.4 for security fix

* remove package-lock.json

* adjust test expectation about error message to work in recent Node versions

* #3 Add context filtering and legacy to single kind conversion. (#238)

Co-authored-by: Eli Bishop <[email protected]>

* #4 Switch from user to context for events. (#244)

Co-authored-by: Eli Bishop <[email protected]>

* #5 Rlamb/sc 142950/implement u2c evaluation (#248)

Co-authored-by: Eli Bishop <[email protected]>

* #6 Rlamb/sc 145767/attribute reference improvements (#250)

Co-authored-by: Eli Bishop <[email protected]>

* #7 Rlamb/sc 146614/do not support bucketby for experiments (#251)

Co-authored-by: Eli Bishop <[email protected]>

* #8 Rlamb/sc 147263/treat cyclic segements as errors (#252)

Co-authored-by: Eli Bishop <[email protected]>

* Do not use the secondary key for experiments. (#256)

* Resolve issues with V2 test harness. (#258)

* Adds link to Relay Proxy docs

* Update index.d.ts

Co-authored-by: Eli Bishop <[email protected]>

* ensure setTimeout task is cleared when polling is stopped

* fix some flaky tests using async blocking logic

* rm unused

* simplify polling implementation using setInterval

* Update the test data source for U2C. (#257)

* use newer js-test-helpers for async tests

* add request number to timeout message

* Enforce 64 character limit for application tag values. (#263)

* Changed transient back to anonymous. (#264)

* Fixed operator field key name in TestDataRuleBuilder (#246)

* Do not set `inExperiment`  if there is not a context for the specified kind. (#266)

* [sc-160948] Switch to partial URL encoding. (#265)

* Update event schema version. (#267)

* [sc-171125] Do now allow indexing into an array with an attribute reference. (#268)

* [sc-174033] Remove support for secondary. (#269)

* Treat 'kind' and '/kind' the same. (#270)

* [sc-176598] Update node U2C with latest changes from main. (#272)

* [sc-176599] Update documentation for privateAttributes _meta attribute of contexts. (#271)

* Remove copy/paste error. (#274)

* [sc-177983] Add support for executing old style user tests. (#275)

* Update release metadata.

* Do not generate events for bad contexts. (#277)

Co-authored-by: Yusinto Ngadiman <[email protected]>

* Handle nested segment dependencies. (#278)

* fix: bump async dependencies

---------

Co-authored-by: Eli Bishop <[email protected]>
Co-authored-by: LaunchDarklyCI <[email protected]>
Co-authored-by: Maxwell Gerber <[email protected]>
Co-authored-by: Chris West <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Mike Zorn <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: Robert J. Neal <[email protected]>
Co-authored-by: Ben Levy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: belevy <[email protected]>
Co-authored-by: charukiewicz <[email protected]>
Co-authored-by: LaunchDarklyReleaseBot <[email protected]>
Co-authored-by: Ryan Lamb <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
Co-authored-by: Yusinto Ngadiman <[email protected]>
Co-authored-by: Louis Chan <[email protected]>
Co-authored-by: Louis Chan <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants