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

prepare 6.4.2 release #250

Merged
merged 574 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
574 commits
Select commit Hold shift + click to select a range
3da81f7
Merge pull request #157 from launchdarkly/eb/ch56656/http-test-cleanup
eli-darkly Nov 23, 2019
14f5f61
Merge pull request #158 from launchdarkly/eb/ch56656/better-async-helper
eli-darkly Nov 23, 2019
4f16b1d
revise tests to use new helper package
eli-darkly Nov 23, 2019
79db3e0
Merge branch 'master' into diag-events-merged
eli-darkly Nov 23, 2019
af8e51e
Merge branch 'diagnostic-events' into eb/ch56381/diag-events-2-initial
eli-darkly Nov 23, 2019
9630ddb
misc cleanup
eli-darkly Nov 23, 2019
31a9b41
Merge pull request #160 from launchdarkly/eb/ch56381/diag-events-2-in…
eli-darkly Nov 23, 2019
75a9cd2
Merge branch 'diagnostic-events' into eb/ch56381/diag-events-3-stream
eli-darkly Nov 23, 2019
81d5249
Merge pull request #161 from launchdarkly/eb/ch56381/diag-events-3-st…
eli-darkly Nov 23, 2019
90ef205
Merge branch 'master' into eb/ch57131/new-test-package
eli-darkly Nov 23, 2019
677e1b2
use launchdarkly-js-test-helpers 1.0.0
eli-darkly Nov 26, 2019
438cf91
fix package reference
eli-darkly Nov 26, 2019
d7208df
minor fixes to config validation messages + add comment
eli-darkly Dec 4, 2019
cc9dbed
Merge pull request #163 from launchdarkly/eb/ch56521/config-validatio…
eli-darkly Dec 4, 2019
c015310
Merge branch 'master' into diagnostic-events
eli-darkly Dec 5, 2019
1f75d71
Merge pull request #162 from launchdarkly/eb/ch57131/new-test-package
eli-darkly Dec 6, 2019
1eea22e
Merge branch 'master' into diagnostic-events
eli-darkly Dec 9, 2019
aace735
diagnostic eventsInQueue counter should be # of events at last flush
eli-darkly Dec 9, 2019
1fb38d1
rename eventsInQueue to eventsInLastBatch
eli-darkly Dec 10, 2019
d270a35
Merge pull request #164 from launchdarkly/eb/ch56381-ch58405/diagnost…
eli-darkly Dec 11, 2019
f866ab4
merge from public after release
LaunchDarklyCI Dec 11, 2019
24b85c3
don't let user fall outside of last bucket in rollout
bwoskow-ld Dec 24, 2019
561ed34
add unit tests for basic bucketing logic and edge case
eli-darkly Dec 30, 2019
359678e
avoid redundant property lookups
eli-darkly Dec 30, 2019
787c9e3
Merge pull request #165 from launchdarkly/bw/ch43307/bucket-issue
eli-darkly Jan 3, 2020
cea2d8a
merge from public after release
LaunchDarklyCI Jan 6, 2020
e9d2cfd
fix Redis client parameter to match TS declaration (but still support…
eli-darkly Jan 13, 2020
cc98785
Merge pull request #166 from launchdarkly/eb/ch61188/redis-params
eli-darkly Jan 13, 2020
cc96ab8
merge from public after release
LaunchDarklyCI Jan 13, 2020
b099acf
add event payload ID
eli-darkly Jan 14, 2020
68fc8f8
remove mistakenly checked-in test code (note, this SDK key was only v…
eli-darkly Jan 14, 2020
603d788
Merge pull request #167 from launchdarkly/eb/ch61092/payload-id
eli-darkly Jan 14, 2020
b0f4e0b
merge from public after release
LaunchDarklyCI Jan 15, 2020
8bad3d5
add mention of singleton usage
eli-darkly Feb 11, 2020
50c3497
Merge pull request #168 from launchdarkly/eb/ch65200/singleton-comment
eli-darkly Feb 11, 2020
47e13c8
Merge branch 'master' into diagnostic-events
eli-darkly Feb 11, 2020
315e9ba
update diagnostic event info for OS name, data store type, Node version
eli-darkly Feb 11, 2020
e012522
standardize linting
eli-darkly Feb 11, 2020
6af8688
disallow window and document
eli-darkly Feb 11, 2020
d600230
fix null/undef checks
eli-darkly Feb 11, 2020
c80f85e
misc linting fixes
eli-darkly Feb 12, 2020
5feaef6
Merge pull request #170 from launchdarkly/eb/ch65303/linting
eli-darkly Feb 12, 2020
3d1a4dd
Merge pull request #169 from launchdarkly/eb/ch62088/spec-updates
eli-darkly Feb 12, 2020
62304d2
inlineUsersInEvents is not an unknown option
eli-darkly Feb 12, 2020
d008bc6
drop node-sha1 dependency
eli-darkly Feb 12, 2020
2965a25
Merge pull request #171 from launchdarkly/eb/ch65544/unknown-option
eli-darkly Feb 12, 2020
9a8bc0f
Merge pull request #172 from launchdarkly/eb/ch65523/sha1-module
eli-darkly Feb 12, 2020
e4849e0
Merge branch 'master' into diagnostic-events
eli-darkly Feb 12, 2020
d80cb60
merge from public after release
LaunchDarklyCI Feb 12, 2020
66b65f0
don't omit streamInits.failed when it's false
eli-darkly Feb 14, 2020
0387358
Merge pull request #173 from launchdarkly/eb/ch65817/diagnostic-expli…
eli-darkly Feb 14, 2020
9913d25
merge from public after release
LaunchDarklyCI Feb 14, 2020
59c9687
bump request dependency to get security patch; loosen some exact depe…
eli-darkly Feb 20, 2020
aff36e4
remove request package; improve polling cache logic + add test
eli-darkly Feb 20, 2020
f2e68a4
bump typescript version to fix build error in Node 6
eli-darkly Feb 20, 2020
e754252
update @types/node to fix TypeScript check step
eli-darkly Feb 20, 2020
23e02c0
Merge pull request #174 from launchdarkly/eb/ch66555/request-dep
eli-darkly Feb 20, 2020
a99c572
Merge branch 'master' into eb/ch66553/drop-request-package
eli-darkly Feb 20, 2020
9b30917
lint
eli-darkly Feb 20, 2020
8cc01d2
merge from public after release
LaunchDarklyCI Feb 20, 2020
37196b9
make sure we keep polling regardless of whether we got new data
eli-darkly Mar 9, 2020
12c8594
Merge pull request #175 from launchdarkly/eb/ch66553/drop-request-pac…
eli-darkly Mar 9, 2020
5ef755f
merge from public after release
LaunchDarklyCI Mar 9, 2020
4aaaf65
use launchdarkly-eventsource, make stream retry behavior consistent
eli-darkly Apr 3, 2020
e213d02
Merge pull request #176 from launchdarkly/eb/ch69693/stream-retry
eli-darkly Apr 3, 2020
ef5de0b
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Apr 3, 2020
b626468
stream retry delay option should be in seconds & should be included i…
eli-darkly Apr 3, 2020
9dd0e9c
Merge pull request #177 from launchdarkly/eb/ch72241/stream-retry-option
eli-darkly Apr 7, 2020
7d143b6
minor test fix
eli-darkly Apr 7, 2020
b2a8a1d
merge from public after release
LaunchDarklyCI Apr 7, 2020
2e084b2
fix: Throw an error on malformed user-supplied logger
maxwellgerber Apr 22, 2020
c666c0f
don't call unref() on Redis client; ensure that database integration …
eli-darkly Apr 22, 2020
40f9754
Merge pull request #178 from launchdarkly/eb/ch25282/redis-unref
eli-darkly Apr 22, 2020
3d558cf
update Redis driver to major version 3
eli-darkly Apr 22, 2020
00c6da8
add test case
maxwellgerber Apr 22, 2020
bfcd711
allow redisOpts parameter to be omitted
eli-darkly Apr 23, 2020
66353c2
add logger adapter shim + tests
maxwellgerber Apr 23, 2020
cf98f97
Merge pull request #179 from launchdarkly/eb/ch74036/redis3
eli-darkly Apr 23, 2020
ac46536
Merge pull request #185 from maxwellgerber/fix/throw-err-on-malformed…
eli-darkly Apr 23, 2020
7c08df2
Merge branch 'contrib' of github.com:launchdarkly/node-server-sdk
eli-darkly Apr 23, 2020
1b94b45
minor cleanup and comments for ch74741 fix (logger wrapper)
eli-darkly Apr 23, 2020
194fc9e
fix proxy tunnel configuration and make sure it's used in streaming
eli-darkly Apr 24, 2020
11210de
Merge pull request #181 from launchdarkly/eb/ch74739/streaming-proxy
eli-darkly Apr 24, 2020
10ab5ab
merge from public after release
LaunchDarklyCI Apr 25, 2020
12949a2
change some string concatenation expressions to use interpolation
eli-darkly May 4, 2020
9f16efb
Merge branch 'master' into eb/ch74741/logger-wrapper-followup
eli-darkly May 4, 2020
a3b70cc
Merge pull request #180 from launchdarkly/eb/ch74741/logger-wrapper-f…
eli-darkly May 4, 2020
a1762e2
feat: upgrade winston (#189)
FauxFaux Jun 23, 2020
02e90a3
Merge branch 'contrib' of github.com:launchdarkly/node-server-sdk
eli-darkly Jun 23, 2020
3fbcf83
fix merge
eli-darkly Jun 24, 2020
a4ae3ad
remove support for indirect/patch and indirect/put (#182)
eli-darkly Jun 25, 2020
2780797
reuse same Promise and same event listeners for all waitForInitializa…
eli-darkly Jun 26, 2020
b73ca82
Merge pull request #183 from launchdarkly/eb/ch80833/wait-for-init-li…
eli-darkly Jun 26, 2020
64b8869
better docs for waitForInitialization + misc doc cleanup (#184)
eli-darkly Jun 30, 2020
2f0c4c0
update js-eventsource to 1.3.1 for stream parsing bugfix (#185)
eli-darkly Jun 30, 2020
179d838
merge from public after release
LaunchDarklyCI Jun 30, 2020
5c52e9e
fix broken logger format (#186)
eli-darkly Jun 30, 2020
804c424
merge from public after release
LaunchDarklyCI Jun 30, 2020
09d03b6
retroactively update changelog for bugfix in 5.13.2 release
eli-darkly Jul 8, 2020
a16805c
Merge pull request #187 from launchdarkly/eb/ch80833/bugfix-changelog
eli-darkly Jul 8, 2020
b858395
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Aug 5, 2020
0a28e52
allow get/getAll Redis queries to be queued if Redis client hasn't ye…
eli-darkly Aug 27, 2020
9bedee0
Merge pull request #188 from launchdarkly/eb/ch87993/redis-connect-state
eli-darkly Aug 27, 2020
1e90630
merge from public after release
LaunchDarklyCI Aug 28, 2020
abfcf7f
set stream read timeout
eli-darkly Jan 26, 2021
4f8774e
Merge pull request #189 from launchdarkly/eb/ch73764/stream-read-timeout
eli-darkly Jan 26, 2021
0882774
merge from public after release
LaunchDarklyCI Jan 26, 2021
c4b9f3a
adding the alias functionality (#190)
bwoskow-ld Jan 29, 2021
0e24961
merge from public after release
LaunchDarklyCI Jan 29, 2021
26ebc52
Removed the guides link
bwoskow-ld Feb 3, 2021
4307257
remove monkey-patching of setImmediate
eli-darkly Feb 8, 2021
ad3e106
Merge pull request #191 from launchdarkly/eb/ch100514/no-monkey-patch
eli-darkly Feb 8, 2021
43eee0e
merge from public after release
LaunchDarklyCI Feb 9, 2021
4b3ad52
Persist contextKind property during feature and custom event transfor…
bwoskow-ld Feb 11, 2021
5210f46
merge from public after release
LaunchDarklyCI Feb 11, 2021
d9b7597
add inlineUsersInEvents option in TypeScript
eli-darkly Mar 30, 2021
8e425a0
Merge pull request #197 from launchdarkly/eb/ch103585/inline-property
eli-darkly Apr 1, 2021
3e3db9c
merge from public after release
LaunchDarklyCI Apr 1, 2021
05d80fc
Add support for seed to bucketUser
mike-zorn Apr 16, 2021
70277ce
Add note for incorporating seed into evaluation
mike-zorn Apr 21, 2021
94a1016
Send events when the evaluation is from an experiment
mike-zorn Apr 22, 2021
8da6541
Use seed to evaluate.
mike-zorn Apr 22, 2021
db5c28c
Clean up test descriptions
mike-zorn Apr 22, 2021
520da38
Rename variable to be less confusing
mike-zorn Apr 23, 2021
48af02d
Use ternary to eliminate mutation
mike-zorn Apr 23, 2021
10a2377
Make return signature more consistent
mike-zorn Apr 23, 2021
8707999
Un-prettier the tests
mike-zorn Apr 23, 2021
d8e7cbb
Add traffic allocation support (#198)
mike-zorn Apr 26, 2021
293c6a5
redis lower bounds bump (#199)
bwoskow-ld Apr 28, 2021
6330aef
merge from public after release
LaunchDarklyCI Apr 29, 2021
7b450e3
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
bwoskow-ld May 11, 2021
8bfea5f
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
bwoskow-ld May 24, 2021
c1a91f8
Merge branch 'master' into exp-alloc
robertjneal Jun 4, 2021
71b3579
update launchdarkly-js-test-helpers to fix TLS tests (#200)
eli-darkly Jun 9, 2021
473a1c1
update js-eventsource to remove vulnerability warning (#201)
eli-darkly Jun 10, 2021
ae3a860
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Jun 10, 2021
d937730
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
bwoskow-ld Jun 11, 2021
3e55ee1
add CI jobs for all compatible Node versions
eli-darkly Jun 12, 2021
895a7b7
CI fixes
eli-darkly Jun 12, 2021
b42ac5d
more CI fixes
eli-darkly Jun 12, 2021
da29df1
comment
eli-darkly Jun 12, 2021
439c16b
use default value to simplify config
eli-darkly Jun 12, 2021
6aed521
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
bwoskow-ld Jun 14, 2021
7520d6c
Merge branch 'master' into 6.0
eli-darkly Jun 14, 2021
9b534c7
(6.0 - #1) stop saying we're compatible with Node <12 (#203)
eli-darkly Jun 14, 2021
b6da495
add CI jobs for all compatible Node versions (#202)
eli-darkly Jun 14, 2021
23eda3b
Merge branch 'master' into 6.0
eli-darkly Jun 14, 2021
847a903
(6.0 - #2) remove Redis integration (#204)
eli-darkly Jun 14, 2021
679f879
allow feature store to be specified as a factory (so it can get our l…
eli-darkly Jun 14, 2021
ecf5135
(6.0 - #3) remove Winston (#205)
eli-darkly Jun 14, 2021
19cc663
remove deprecated things for 6.0 (#206)
eli-darkly Jun 14, 2021
2381b91
Merge pull request #207 from launchdarkly/eb/ch111387/data-store-factory
eli-darkly Jun 14, 2021
868128b
update node-cache to 5.x (drops old Node compat)
eli-darkly Jun 15, 2021
1191c2e
update semver to 7.x (drops old Node compat)
eli-darkly Jun 15, 2021
38ead49
update uuid to 8.x (Node compat, perf improvements, bugfixes)
eli-darkly Jun 15, 2021
4930fc7
update dev dependencies
eli-darkly Jun 15, 2021
2ad6d55
linter
eli-darkly Jun 15, 2021
010a1a5
Merge pull request #208 from launchdarkly/eb/ch111699/update-deps
eli-darkly Jun 15, 2021
3ae053a
replace lrucache package with lru-cache (#209)
eli-darkly Jun 15, 2021
59e2f82
make yaml dependency optional (#210)
eli-darkly Jun 15, 2021
d292f74
update release metadata to include maintenance branch
eli-darkly Jun 15, 2021
4a5dc99
Merge branch '6.0'
eli-darkly Jun 15, 2021
6a1c746
remove package-lock.json (#211)
eli-darkly Jun 17, 2021
a95ddfe
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Jun 17, 2021
e74c640
rm prerelease changelog
eli-darkly Jun 17, 2021
4237116
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Jun 17, 2021
bb0a957
Merge branch 'exp-alloc'
eli-darkly Jun 17, 2021
117273c
merge from public after release
LaunchDarklyCI Jun 21, 2021
6b60b95
(big segments #1) add interfaces for big segments (#212)
eli-darkly Jul 6, 2021
50e62ce
(big segments #2) add all components for big segments except evaluati…
eli-darkly Jul 7, 2021
5c35f86
(big segments #3) implement big segments in flag evaluation (#214)
eli-darkly Jul 16, 2021
b984806
(big segments #4) add standard test suite for big segment store tests…
eli-darkly Jul 16, 2021
393c631
move new interfaces to a module instead of a namespace (#216)
eli-darkly Jul 19, 2021
042ecc1
fix TS export of CachingStoreWrapper
eli-darkly Jul 19, 2021
ed7ddf3
Merge pull request #217 from launchdarkly/eb/ch108418/fix-caching-sto…
eli-darkly Jul 19, 2021
89a8709
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Jul 22, 2021
9de933b
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Aug 13, 2021
d778b68
use Releaser v2 config
eli-darkly Sep 21, 2021
d451fb0
Merge pull request #218 from launchdarkly/eb/ch118712/releaser-v2
eli-darkly Sep 21, 2021
fe75863
fix overly specific test expectation that breaks in Node 17
eli-darkly Nov 16, 2021
81d571c
Merge pull request #220 from launchdarkly/eb/sc-131661/fix-test
eli-darkly Nov 17, 2021
093070c
Initial work on FlagBuilder (#219)
belevy Nov 18, 2021
6679f53
implemented FlagRuleBuilder; added .build() methods to FlagBuilder/Fl…
charukiewicz Nov 17, 2021
c72c4b7
converted _targets to be Map instead of object literal; changed varia…
charukiewicz Nov 18, 2021
2bfe43d
Implement stream processor(data source) interface for test data
belevy Nov 18, 2021
1758a5f
Add TestData to index.js and write out the types for TestData and fri…
belevy Nov 18, 2021
eca4ebe
added testdata documentation to index.d.ts; fix linter errors; change…
charukiewicz Nov 18, 2021
03684bf
Merge pull request #221 from launchdarkly/cc/sc-130601/test-data-flag…
charukiewicz Nov 24, 2021
6cd3148
Fix the interface file: reindented to 2 spaces, corrected definition …
belevy Nov 24, 2021
174c870
modify tests to fix capitalization and actually test the test datasou…
belevy Nov 24, 2021
c14fcaf
Fix linter error on defaulted callback
belevy Nov 29, 2021
2cf0e26
explicitly enable JSDOM types in TypeScript build to avoid errors whe…
eli-darkly Nov 29, 2021
cae489f
capitalize Big Segments in docs & logs
eli-darkly Nov 30, 2021
dce0a1d
Merge branch 'eb/sc-132761/typescript-jsdom-errors' into eb/sc-120149…
eli-darkly Nov 30, 2021
69a98dd
Merge pull request #223 from launchdarkly/eb/sc-132761/typescript-jsd…
eli-darkly Nov 30, 2021
91988cc
Merge pull request #224 from launchdarkly/eb/sc-120149/big-segments-n…
eli-darkly Nov 30, 2021
d7f500e
Merge branch 'master' into test-data
eli-darkly Nov 30, 2021
c965023
Merge branch 'test-data' into bl/sc-130601/test-data-data-source
eli-darkly Nov 30, 2021
9e268ad
Merge pull request #222 from launchdarkly/bl/sc-130601/test-data-data…
belevy Nov 30, 2021
3e2bf09
documentation comment fixes for TestData
eli-darkly Dec 6, 2021
6900fb1
Merge pull request #226 from launchdarkly/eb/sc-130601/comment-fixes
belevy Dec 7, 2021
930700e
pin TypeScript to 4.4.x
eli-darkly Dec 8, 2021
00b0e42
Merge pull request #227 from launchdarkly/eb/sc-72228/pin-typescript-…
eli-darkly Dec 8, 2021
82830ce
move TestData and FIleDataSource to integrations module
eli-darkly Dec 8, 2021
8ce8686
lint
eli-darkly Dec 8, 2021
715000b
Merge pull request #228 from launchdarkly/eb/sc-130601/test-data-module
eli-darkly Dec 8, 2021
9ef8b01
rename types used by TestData for clarity (#229)
eli-darkly Dec 8, 2021
a8b19f3
use varargs semantics for TestFlagBuilder.variations() and add it to …
eli-darkly Dec 9, 2021
2d688ce
don't ever use for...in (#232)
eli-darkly Dec 10, 2021
6577fa8
merge from public after release
Dec 11, 2021
4054d85
bump launchdarkly-eventsource dependency for sc-136154 fix
eli-darkly Jan 4, 2022
94af72c
use TestData in our own tests (#231)
eli-darkly Jan 4, 2022
f4b88da
Merge pull request #233 from launchdarkly/eb/sc-136154/js-eventsource…
eli-darkly Jan 4, 2022
91b19a3
merge from public after release
Jan 4, 2022
11a92fb
fix allFlagsState behavior regarding experimentation
eli-darkly Feb 2, 2022
5310a45
lint
eli-darkly Feb 2, 2022
0b81dbf
allow "secondary" to be referenced in clauses
eli-darkly Feb 2, 2022
5a6b089
don't throw an exception for non-string in semver comparison
eli-darkly Feb 2, 2022
c1a98b8
correctly handle "client not ready" condition in allFlagsState
eli-darkly Feb 2, 2022
b144ac0
lint
eli-darkly Feb 2, 2022
2aad9b0
Merge pull request #235 from launchdarkly/eb/sc-140526/misc-test-fixes
eli-darkly Feb 4, 2022
33ac182
Merge pull request #234 from launchdarkly/eb/sc-137721/all-flags-expe…
eli-darkly Feb 4, 2022
4b01f5d
merge from public after release
Feb 4, 2022
5a13869
Merge branch 'master' into test-data
eli-darkly Feb 19, 2022
2d86ee7
merge from public after release
Feb 19, 2022
d4ab468
Flags with a version of 0 reported as 'unknown' in summary events. (#…
kinyoklion Mar 2, 2022
897ae8b
implement contract test service, not including big segments (#242)
kinyoklion Mar 4, 2022
663bd06
Implement Application tags for the node SDK. (#241)
kinyoklion Mar 10, 2022
f98493c
update js-eventsource to 1.4.4 for security fix
eli-darkly Mar 10, 2022
e7b6981
Merge pull request #245 from launchdarkly/eb/sc-145320/eventsource-up…
eli-darkly Mar 10, 2022
cddd337
merge from public after release
Mar 10, 2022
aed4277
merge from public after release
Mar 23, 2022
1910bf7
remove package-lock.json
eli-darkly Mar 25, 2022
f3de0ac
adjust test expectation about error message to work in recent Node ve…
eli-darkly Mar 25, 2022
a878383
Merge pull request #253 from launchdarkly/eb/sc-107301/remove-lockfile
eli-darkly Mar 26, 2022
d725317
Adds link to Relay Proxy docs
ember-stevens Apr 19, 2022
99dfb0b
Update index.d.ts
ember-stevens Apr 19, 2022
c324ea2
Merge pull request #259 from launchdarkly/emberstevens/sc-150321/stan…
ember-stevens Apr 19, 2022
876295d
ensure setTimeout task is cleared when polling is stopped
eli-darkly Apr 21, 2022
c65c778
fix some flaky tests using async blocking logic
eli-darkly Apr 21, 2022
4174774
rm unused
eli-darkly Apr 21, 2022
6ba1871
simplify polling implementation using setInterval
eli-darkly Apr 21, 2022
b1688c5
Merge pull request #260 from launchdarkly/eb/sc-150770/clear-poll-tim…
eli-darkly Apr 22, 2022
b602ad4
Merge pull request #261 from launchdarkly/eb/sc-149305/flaky-tests
eli-darkly Apr 25, 2022
ab604f9
merge from public after release
Apr 26, 2022
09a8008
use newer js-test-helpers for async tests
eli-darkly Apr 26, 2022
f208f8f
add request number to timeout message
eli-darkly Apr 26, 2022
9a29bb8
Merge pull request #262 from launchdarkly/eb/sc-149305/async-helpers
eli-darkly Apr 27, 2022
26975d0
Merge branch 'main' of github.com:launchdarkly/node-server-sdk
eli-darkly May 7, 2022
968571f
Enforce 64 character limit for application tag values. (#263)
kinyoklion May 16, 2022
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
11 changes: 7 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ workflows:
docker-image: cimg/node:current
run-lint: true
- build-test-linux:
name: Node 16.3
docker-image: cimg/node:16.3
name: Node 17.9
docker-image: cimg/node:17.9
- build-test-linux:
name: Node 16.14
docker-image: cimg/node:16.14
- build-test-linux:
name: Node 15.14
docker-image: cimg/node:15.14
- build-test-linux:
name: Node 14.17
docker-image: cimg/node:14.17
name: Node 14.19
docker-image: cimg/node:14.19
- build-test-linux:
name: Node 13.14
docker-image: cimg/node:13.14
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ To verify that the TypeScript declarations compile correctly (this involves comp
npm run check-typescript
```

To run the SDK contract test suite (see [`contract-tests/README.md`](./contract-tests/README.md)):

```bash
npm run contract-tests
```

### Auditing package dependencies

The `npm audit` tool compares all dependencies and transitive dependencies to a database of package versions with known vulnerabilities. However, the output of this tool includes both runtime and development dependencies.
Expand Down
4 changes: 4 additions & 0 deletions configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ module.exports = (function () {
config.logger.warn(messages.invalidTagValue(name));
return undefined;
}
if (tagValue.length > 64) {
config.logger.warn(messages.tagValueTooLong(name));
return undefined;
}
return tagValue;
}

Expand Down
2 changes: 2 additions & 0 deletions messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ exports.wrongOptionTypeBoolean = (name, actualType) =>
`Config option "${name}" should be a boolean, got ${actualType}, converting to boolean`;

exports.invalidTagValue = name => `Config option "${name}" must only contain letters, numbers, ., _ or -.`;

exports.tagValueTooLong = name => `Value of "${name}" was longer than 64 characters and was discarded.`;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"eslint-plugin-prettier": "^3.4.0",
"jest": "^27.0.4",
"jest-junit": "^12.2.0",
"launchdarkly-js-test-helpers": "^1.2.1",
"launchdarkly-js-test-helpers": "^2.2.0",
"prettier": "^2.3.1",
"tmp": "^0.2.1",
"typescript": "~4.4.4",
Expand Down
6 changes: 3 additions & 3 deletions test/LDClient-tls-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import {
AsyncQueue,
TestHttpHandlers,
TestHttpServer,
failOnTimeout,
withCloseable
} from 'launchdarkly-js-test-helpers';
import * as stubs from './stubs';
import { failIfTimeout } from './test_helpers';

describe('LDClient TLS configuration', () => {
const sdkKey = 'secret';
Expand Down Expand Up @@ -46,9 +46,9 @@ describe('LDClient TLS configuration', () => {
};

await withCloseable(LDClient.init(sdkKey, config), async client => {
const message1 = await failIfTimeout(logCapture.warn.take(), 1000);
const message1 = await failOnTimeout(logCapture.warn.take(), 1000, 'timed out waiting for log message');
expect(message1).toMatch(/only disable the streaming API/); // irrelevant message due to our use of polling mode
const message2 = await failIfTimeout(logCapture.warn.take(), 1000);
const message2 = await failOnTimeout(logCapture.warn.take(), 1000, 'timed out waiting for log message');
expect(message2).toMatch(/self.signed/);
});
});
Expand Down
7 changes: 7 additions & 0 deletions test/configuration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ describe('configuration', function() {
expect(configIn.logger.warn).toHaveBeenCalledTimes(1);
});

it('logs a warning when a tag value is too long', async () => {
const configIn = emptyConfigWithMockLogger();
configIn.application = { id: 'a'.repeat(65), version: 'b'.repeat(64) };
expect(configuration.validate(configIn).application.id).toBeUndefined();
expect(configIn.logger.warn).toHaveBeenCalledTimes(1);
});

it('handles a valid application version', () => {
const configIn = emptyConfigWithMockLogger();
configIn.application = {version: 'test-version'};
Expand Down
7 changes: 3 additions & 4 deletions test/event_processor-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { DiagnosticsManager, DiagnosticId } = require('../diagnostic_events');
const EventProcessor = require('../event_processor');
const { TestHttpHandlers, TestHttpServer, withCloseable } = require('launchdarkly-js-test-helpers');
const { failIfTimeout } = require('./test_helpers');
const { failOnTimeout, TestHttpHandlers, TestHttpServer, withCloseable } = require('launchdarkly-js-test-helpers');

describe('EventProcessor', () => {

Expand Down Expand Up @@ -657,8 +656,8 @@ describe('EventProcessor', () => {
ep.sendEvent({ kind: 'identify', creationDate: 1000, user: user });

// unfortunately we must wait for both the flush interval and the 1-second retry interval
await failIfTimeout(s.nextRequest(), 500);
await failIfTimeout(s.nextRequest(), 1500);
await failOnTimeout(s.nextRequest(), 500, 'timed out waiting for event payload');
await failOnTimeout(s.nextRequest(), 1500, 'timed out waiting for event payload');
});
}));

Expand Down
16 changes: 8 additions & 8 deletions test/polling-test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const InMemoryFeatureStore = require('../feature_store');
const PollingProcessor = require('../polling');
const dataKind = require('../versioned_data_kind');
const { AsyncQueue, promisify, promisifySingle } = require('launchdarkly-js-test-helpers');
const { AsyncQueue, failOnResolve, failOnTimeout, promisify, promisifySingle } = require('launchdarkly-js-test-helpers');
const stubs = require('./stubs');
const { failIfTimeout } = require('./test_helpers');

describe('PollingProcessor', () => {
const longInterval = 100000;
Expand Down Expand Up @@ -81,7 +80,7 @@ describe('PollingProcessor', () => {
processor.start(() => {});
const startTime = new Date().getTime();
for (let i = 0; i < 4; i++) {
await failIfTimeout(calls.take(), 500);
await failOnTimeout(calls.take(), 500, 'timed out waiting for poll request #' + (i + 1));
}
expect(new Date().getTime() - startTime).toBeLessThanOrEqual(500);
});
Expand All @@ -107,9 +106,9 @@ describe('PollingProcessor', () => {
let errReceived;
processor.start(e => { errReceived = e; });

await failIfTimeout(calls.take(), 500);
await failIfTimeout(calls.take(), 500);
await failIfTimeout(calls.take(), 500);
for (let i = 0; i < 3; i++) {
await failOnTimeout(calls.take(), 500, 'timed out waiting for poll request #' + (i + 1));
}

expect(config.logger.error).not.toHaveBeenCalled();
expect(errReceived).toBeUndefined();
Expand Down Expand Up @@ -143,10 +142,11 @@ describe('PollingProcessor', () => {
const result = new AsyncQueue();
processor.start(e => result.add(e));

const errReceived = await failIfTimeout(result.take(), 1000);
const errReceived = await failOnTimeout(result.take(), 1000, 'timed out waiting for initialization to complete');
expect(errReceived.message).toMatch(new RegExp('error ' + status + '.*giving up permanently'));

expect(calls.length()).toEqual(1);
await failOnTimeout(calls.take(), 10, 'expected initial poll request but did not see one');
await failOnResolve(calls.take(), 100, 'received unexpected second poll request');
expect(config.logger.error).toHaveBeenCalledTimes(1);
}

Expand Down
13 changes: 6 additions & 7 deletions test/streaming-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ const { DiagnosticId, DiagnosticsManager } = require('../diagnostic_events');
const InMemoryFeatureStore = require('../feature_store');
const StreamProcessor = require('../streaming');
import * as httpUtils from '../utils/httpUtils';
import { failIfResolves, failIfTimeout } from './test_helpers';
const dataKind = require('../versioned_data_kind');

const { promisifySingle } = require('launchdarkly-js-test-helpers');
const { failOnResolve, failOnTimeout, promisifySingle } = require('launchdarkly-js-test-helpers');
const stubs = require('./stubs');

describe('StreamProcessor', () => {
Expand Down Expand Up @@ -258,10 +257,10 @@ describe('StreamProcessor', () => {

es.instance.simulateError(err);

await failIfTimeout(logCapture.warn.take(), 1000);
await failOnTimeout(logCapture.warn.take(), 1000, 'timed out waiting for log message');

await failIfResolves(waitForStart, 50);
await failIfResolves(logCapture.error.take(), 50);
await failOnResolve(waitForStart, 50, 'initialization completed unexpectedly');
await failOnResolve(logCapture.error.take(), 50, 'got unexpected log error');

expect(es.closed).not.toBeTruthy();

Expand Down Expand Up @@ -297,11 +296,11 @@ describe('StreamProcessor', () => {

const waitForStart = promisifySingle(sp.start)();
es.instance.simulateError(err);
const errReceived = await failIfTimeout(waitForStart, 1000);
const errReceived = await failOnTimeout(waitForStart, 1000, 'timed out waiting for error result');

expect(errReceived).toEqual(err);

await failIfTimeout(logCapture.error.take(), 50);
await failOnTimeout(logCapture.error.take(), 50, 'timed out waiting for log error');

expect(es.closed).toBe(true);

Expand Down
38 changes: 0 additions & 38 deletions test/test_helpers.js

This file was deleted.