Skip to content

Conversation

@eli-darkly
Copy link
Contributor

[2.8.0] - 2018-12-03

Added:

  • The use of a streaming connection to LaunchDarkly for receiving live updates can now be controlled with the new client.setStreaming() method, or the equivalent boolean streaming property in the client configuration. If you set this to false, the client will not open a streaming connection even if you subscribe to change events (you might want to do this if, for instance, you just want to be notified when the client gets new flag values due to having switched users). If you set it to true, the client will open a streaming connection regardless of whether you subscribe to change events or not (the flag values will simply be updated in the background). If you don't set it either way then the default behavior still applies, i.e. the client opens a streaming connection if and only if you subscribe to change events.

Fixed:

  • If the client opened a streaming connection because you called on('change', ...) one or more times, it will not close the connection until you call off() for all of your event listeners. Previously, it was closing the connection whenever off('change') was called, even if you still had a listener for 'change:specific-flag-key'.
  • The client's logic for signaling a change event was using a regular Javascript === comparison, so it could incorrectly decide that a flag had changed if its value was a JSON object or an array. This has been fixed to use deep equality checking for object and array values.

apucacao and others added 29 commits October 17, 2018 13:38
fix TypeScript def for event name and add documentation
replace Base64 dependency with a package that has a lowercase name
override short default timeout in one EventSource polyfill
…vent-streaming

allow streaming mode to be decoupled from event subscription
…er-bootstrap

fire change event when updating flags after bootstrap from localstorage
use deep compare to decide whether a flag value has changed
@eli-darkly eli-darkly requested a review from apucacao December 3, 2018 23:19
@eli-darkly eli-darkly merged commit ad5b5a1 into master Dec 3, 2018
@eli-darkly eli-darkly deleted the 2.8.0 branch November 5, 2019 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants