Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reloading page causes stream error #249

Closed
erlendp opened this issue Mar 28, 2022 · 3 comments
Closed

Reloading page causes stream error #249

erlendp opened this issue Mar 28, 2022 · 3 comments

Comments

@erlendp
Copy link

erlendp commented Mar 28, 2022

Describe the bug

I posted this on the React library github issue page (launchdarkly/react-client-sdk#123 (comment)), but looks like it may be more related to the core JS library, so reposting it here instead.

When reloading the React app, the following error is reported on the console:

Error on stream connection: {"isTrusted":true}, will continue retrying every 1000 milliseconds.

This is causing many errors to flood our logs (the error only appears once per reload of the browser page).

To reproduce

  • yarn create react-app launchdarkly-test
  • cd launchdarkly-test
  • yarn add launchdarkly-react-client-sdk
  • Wrap the App component in the withLDProvider HOC:
export default withLDProvider({
  clientSideID: 'xxxxxxx',
})(App);
  • yarn start
  • Ensure 'preserve logs' is checked.
  • Reload page, and the error is reported on the console.

Expected behavior

No error to be reported on reload.

Logs

[LaunchDarkly] Error on stream connection: {"isTrusted":true}, will continue retrying every 1000 milliseconds.

Version

React SDK version: 2.25.1
Browser: Chrome 99.0.4844.83 (Official Build) (x86_64)
OS: Mac OSX 12.0.1

@louis-launchdarkly
Copy link
Contributor

Hello @erlendp, thank you for reaching out, we will look at this and give you an update once we investigate the issue.

Filed Internally as 147957

@kinyoklion
Copy link
Member

kinyoklion commented Mar 31, 2022

Hello @erlendp,

We are looking into this to determine a good way to handle it, or allowing for some configuration to modify the behavior.

We are likely not going to be use beforeunload or unload as there are some unfortunate implications of those events with modern browsers. There is a good write up on page lifecycle, which covers the issues with these events, from google: https://developer.chrome.com/blog/page-lifecycle-api/#:~:text=%23-,Legacy%20lifecycle%20APIs%20to%20avoid,-%23

The primary problem being the way in which they integrate with the backward/forward cache. Either disabling the feature, or being ignored.

So, we will be working to remove our current usage and replace them with API usage which is more friendly to modern browsers. Unfortunately browser support for events which are further into the shutdown process are either discouraged (unload, beforeunload), or they are not consistent between browsers. For instance the freeze/unfreeze events supported in Chrome would be ideal, but they do not have wide browser support.

Until then there are a few different ways that you could mitigate this in your application.

1.) If your application does not need to run when not visible, then you could close the client when the page loses visibility and then re-connect when it becomes visible. Page visibility being one of the most consistently available hooks for this type of work: https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event#:~:text=A%20generic%20Event.-,Usage%20notes,-The%20event%20doesn%27t
(This specific approach will not be taken in the SDK because some apps, for instance a music streaming app, still need to do substantial work when not visible.)

2.) If you aren't concerned with usage of unload, then you could utilize it to disconnect from the LD client.

3.) You could use the logger override in the client options to filter this log. You could also listen to one of the page lifecycle events and disable logging at a time that works for your application.

Thank you,
Ryan

LaunchDarklyReleaseBot added a commit that referenced this issue Apr 27, 2022
* apply markdown templates

* markdown fixes

* rename package ids

* add new JS SDK test/demo page

* misc doc edits

* fixing merge error

* fixing merge error

* fix broken links on npmjs.com (#193)

* update lockfiles for new packages

* fix changelog formatting error that messes up the release script

* Specify unpkg default target file in package.json for
launchdarkly-js-client-sdk and launchdarkly-js-sdk-common.

* Correct requestor call to fetch flags on a received ping event.

* Implement Hooks API (#196)

* Initial commit reusing withLDProvider

* Added sitenav. Cleaned up filenames.

* Updated readme with hooks api docs. Fixed linting errors.

* Fixed linting errors.

* Update README.md

* bumping our lerna version to resolve transitive dependency vulnerabilities with fstream and tar (#198)

* fix goals query logic for Electron, also fix handling of invalid content type

* add ability to alter URL in events

* Update browserPlatform definition to detect when an EventSource
polyfill is available and has published that it supports setting the
method used for the stream. When this is the case, the platform
publishes that it supports using REPORT with EventSource and will
provide the polyfill implementation if the SDK attempts a EventSource
connection with the method set to REPORT.

* Fix initial linter warnings.

* Fix another linter warning.

* fix a broken readme link (#202)

* removing a stray character in the readme

* fix stream reconnect logic and add stream connection logging

* linter

* assume logger always exists, as we do in other components

* fix and simplify how the logger object is passed around

* make it so eventUrlTransformer actually does something

* linter

* copy flags object to prevent subtle update problem in Electron

* additional fix + test

* make bootstrapped flags available immediately

* Refactor some of the EventSource constructor selection logic.

* Change browserPlatform.js to check config options when determining
EventSource implementation to use. Added tests for EventSource factory
in browserPlatform.js

* Deal with linter.

* change how supported options are detected in EventSource polyfill

* fix broken homepage attributes (#209)

* improve bad initialization messages (#210)

* improve bad initialization messages

* remove the spaces

* fixing a broken link in a logged message (#212)

* add jsdelivr attribute to js packages (#213)

* adding an option to disable the camel-casing of flag keys (#214)

* adding an option disabling the camel-casing of flag keys

* update comment

* update comment

* fix linter errors

* address pr feedback

* updated readme

* [ch45487] useCamelCaseFlagKeys option (#215)

* Initial commit

* Update initLDClient.ts

* PR fixes. Added prettier.

* Update withLDProvider.test.tsx

* Fixed lint errors. Added test for useCamelCase false on server changes.

* Removed prettier.

* Re-added prettier

* Update yarn.lock

* Update prettier and lock files.

* Fixed more linting issues.

* fix a typo

* use persistent anonymous user logic by default in react sdk (#216)

* use persistent anonymous user logic by default in react sdk

* added a comment

* minor test change

* missed a line

* remove React package from monorepo

* make link text match link

* improve log format and add configurable prefix

* fix test

* linter

* deprecate samplingInterval

* linter

* improve log message for stream connection failures (#221)

* improve log message for stream connection failures

* update the reconnection warning so that it only displays for the first set of each reconnection attempts

* also test that the original put is getting called

* updating tests

* updating tests

* Revert "updating tests"

This reverts commit 84163cdf8b5af6a6e969d777b946a8a2973919ed.

* better abstraction

* minor change

* updating the js-common readme to mention client-side node (#222)

* remove common package, no more monorepo

* add Releaser metadata

* npm audit fix

* unify Rollup config

* migrate new demo code to new package structure

* moved example folder

* syntax fix in demo

* fix directory name

* fix linting

* use spread operator instead of Object.assign

* don't close client on beforeunload, but do flush events

* typo

* clarify test postconditions

* misc test app improvements for testing beforeunload handler

* rm unused yarn.lock

* rm typedoc dependency, don't commit installation of it during release

* fix paths

* fix file copying logic

* pr template

* revert

* fix programmatically reported version string

* upgrade Typescript to avoid Typedoc incompatibility

* Revert "upgrade Typescript to avoid Typedoc incompatibility"

This reverts commit 34d9a0f.

* update Babel, Jest, Rollup

* remove old releaser (#229)

* remove unused Rollup plugins, update dependencies

* use new config validation mechanism in js-sdk-common 3.x

* add image-loading event delivery logic factored out of js-sdk-common

* enable diagnostic events in JS SDK

* lint

* fix tests

* use common 3.0.0-beta2

* use 3.1.0-beta3, fix property name

* lint

* use js-sdk-common 3.1.0

* use js-sdk-common 3.1.1 for event payload ID fix

* use js-sdk-common 3.1.2 and loosen our other dependency

* fix license

* use js-sdk-common 3.2.0-beta1

* SDK name should be js-client-sdk

* misc fixes

* use js-sdk-common 3.2.0

* use js-sdk-common 3.2.0

* standardize linting

* use js-sdk-common 3.2.1

* use js-sdk-common 3.2.2

* update package-lock

* update js-sdk-common dependency for initialization error bugfix

* update js-sdk-common for content type bugfix; update some dev dependencies

* remove unsafe usage of hasOwnProperty

* use js-sdk-common 3.2.5

* resolve security vulnerability in acorn dependency (#240)

* update js-sdk-common to get console logging IE bugfix

* update js-sdk-common for duplicate diagnostic event fix

* update js-sdk-common for TS decl fix, improve TS compilation test (#243)

* bump to 3.2.9 to get startsWith fix (#244)

* add option to disable sync event flush (#245)

* update js-sdk-common + some dev dependencies

* No longer remove non-section hash in substring and regex matching

* linting

* the linting target to run in CI is "lint:all", not "lint"

* new js-common-sdk version (#249)

* resolve node-notifier vulnerability by updating jest dep (#250)

* adding contextKind to goal events, bumping js-common to get alias function (#251)

* pin typedoc to unblock our releases (#252)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-sdk-common

* Update common JS SDK library to use fixes for debug event generation issues.

* Update package lock.

* use Releaser v2 config + newer CI image (#256)

* Updated readme headers (#258)

* don't log a warning about custom goal being unknown

* lint + comment

* Release js-client-sdk with the header transformation change

* Updates docs link

* bump js-sdk-common version for better localstorage error handling

* Update launchdarkly-js-sdk-common for JSON error handling fix (sc-142333)

* update lockfile

* add basicLogger export

* Update common for application tags support. (#265)

* Re-remove package-lock.json and add it to the .gitignore. (#266)

Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Zach Davis <zach@launchdarkly.com>
Co-authored-by: Elliot <35050275+Apache-HB@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Oct 5, 2022
* add new JS SDK test/demo page

* misc doc edits

* fixing merge error

* fixing merge error

* fix broken links on npmjs.com (#193)

* update lockfiles for new packages

* fix changelog formatting error that messes up the release script

* Specify unpkg default target file in package.json for
launchdarkly-js-client-sdk and launchdarkly-js-sdk-common.

* Correct requestor call to fetch flags on a received ping event.

* Implement Hooks API (#196)

* Initial commit reusing withLDProvider

* Added sitenav. Cleaned up filenames.

* Updated readme with hooks api docs. Fixed linting errors.

* Fixed linting errors.

* Update README.md

* bumping our lerna version to resolve transitive dependency vulnerabilities with fstream and tar (#198)

* fix goals query logic for Electron, also fix handling of invalid content type

* add ability to alter URL in events

* Update browserPlatform definition to detect when an EventSource
polyfill is available and has published that it supports setting the
method used for the stream. When this is the case, the platform
publishes that it supports using REPORT with EventSource and will
provide the polyfill implementation if the SDK attempts a EventSource
connection with the method set to REPORT.

* Fix initial linter warnings.

* Fix another linter warning.

* fix a broken readme link (#202)

* removing a stray character in the readme

* fix stream reconnect logic and add stream connection logging

* linter

* assume logger always exists, as we do in other components

* fix and simplify how the logger object is passed around

* make it so eventUrlTransformer actually does something

* linter

* copy flags object to prevent subtle update problem in Electron

* additional fix + test

* make bootstrapped flags available immediately

* Refactor some of the EventSource constructor selection logic.

* Change browserPlatform.js to check config options when determining
EventSource implementation to use. Added tests for EventSource factory
in browserPlatform.js

* Deal with linter.

* change how supported options are detected in EventSource polyfill

* fix broken homepage attributes (#209)

* improve bad initialization messages (#210)

* improve bad initialization messages

* remove the spaces

* fixing a broken link in a logged message (#212)

* add jsdelivr attribute to js packages (#213)

* adding an option to disable the camel-casing of flag keys (#214)

* adding an option disabling the camel-casing of flag keys

* update comment

* update comment

* fix linter errors

* address pr feedback

* updated readme

* [ch45487] useCamelCaseFlagKeys option (#215)

* Initial commit

* Update initLDClient.ts

* PR fixes. Added prettier.

* Update withLDProvider.test.tsx

* Fixed lint errors. Added test for useCamelCase false on server changes.

* Removed prettier.

* Re-added prettier

* Update yarn.lock

* Update prettier and lock files.

* Fixed more linting issues.

* fix a typo

* use persistent anonymous user logic by default in react sdk (#216)

* use persistent anonymous user logic by default in react sdk

* added a comment

* minor test change

* missed a line

* remove React package from monorepo

* make link text match link

* improve log format and add configurable prefix

* fix test

* linter

* deprecate samplingInterval

* linter

* improve log message for stream connection failures (#221)

* improve log message for stream connection failures

* update the reconnection warning so that it only displays for the first set of each reconnection attempts

* also test that the original put is getting called

* updating tests

* updating tests

* Revert "updating tests"

This reverts commit 84163cdf8b5af6a6e969d777b946a8a2973919ed.

* better abstraction

* minor change

* updating the js-common readme to mention client-side node (#222)

* remove common package, no more monorepo

* add Releaser metadata

* npm audit fix

* unify Rollup config

* migrate new demo code to new package structure

* moved example folder

* syntax fix in demo

* fix directory name

* fix linting

* use spread operator instead of Object.assign

* don't close client on beforeunload, but do flush events

* typo

* clarify test postconditions

* misc test app improvements for testing beforeunload handler

* rm unused yarn.lock

* rm typedoc dependency, don't commit installation of it during release

* fix paths

* fix file copying logic

* pr template

* revert

* fix programmatically reported version string

* upgrade Typescript to avoid Typedoc incompatibility

* Revert "upgrade Typescript to avoid Typedoc incompatibility"

This reverts commit 34d9a0f.

* update Babel, Jest, Rollup

* remove old releaser (#229)

* remove unused Rollup plugins, update dependencies

* use new config validation mechanism in js-sdk-common 3.x

* add image-loading event delivery logic factored out of js-sdk-common

* enable diagnostic events in JS SDK

* lint

* fix tests

* use common 3.0.0-beta2

* use 3.1.0-beta3, fix property name

* lint

* use js-sdk-common 3.1.0

* use js-sdk-common 3.1.1 for event payload ID fix

* use js-sdk-common 3.1.2 and loosen our other dependency

* fix license

* use js-sdk-common 3.2.0-beta1

* SDK name should be js-client-sdk

* misc fixes

* use js-sdk-common 3.2.0

* use js-sdk-common 3.2.0

* standardize linting

* use js-sdk-common 3.2.1

* use js-sdk-common 3.2.2

* update package-lock

* update js-sdk-common dependency for initialization error bugfix

* update js-sdk-common for content type bugfix; update some dev dependencies

* remove unsafe usage of hasOwnProperty

* use js-sdk-common 3.2.5

* resolve security vulnerability in acorn dependency (#240)

* update js-sdk-common to get console logging IE bugfix

* update js-sdk-common for duplicate diagnostic event fix

* update js-sdk-common for TS decl fix, improve TS compilation test (#243)

* bump to 3.2.9 to get startsWith fix (#244)

* add option to disable sync event flush (#245)

* update js-sdk-common + some dev dependencies

* No longer remove non-section hash in substring and regex matching

* linting

* the linting target to run in CI is "lint:all", not "lint"

* new js-common-sdk version (#249)

* resolve node-notifier vulnerability by updating jest dep (#250)

* adding contextKind to goal events, bumping js-common to get alias function (#251)

* pin typedoc to unblock our releases (#252)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-sdk-common

* Update common JS SDK library to use fixes for debug event generation issues.

* Update package lock.

* use Releaser v2 config + newer CI image (#256)

* Updated readme headers (#258)

* don't log a warning about custom goal being unknown

* lint + comment

* Release js-client-sdk with the header transformation change

* Updates docs link

* bump js-sdk-common version for better localstorage error handling

* Update launchdarkly-js-sdk-common for JSON error handling fix (sc-142333)

* update lockfile

* add basicLogger export

* Update common for application tags support. (#265)

* Re-remove package-lock.json and add it to the .gitignore. (#266)

* Use a combination of dependencies that is compatible. (#269) (#270)

* Update js-sdk-common to 3.7.0 (#271)

Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Zach Davis <zach@launchdarkly.com>
Co-authored-by: Elliot <35050275+Apache-HB@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Oct 18, 2022
* fixing merge error

* fixing merge error

* fix broken links on npmjs.com (#193)

* update lockfiles for new packages

* fix changelog formatting error that messes up the release script

* Specify unpkg default target file in package.json for
launchdarkly-js-client-sdk and launchdarkly-js-sdk-common.

* Correct requestor call to fetch flags on a received ping event.

* Implement Hooks API (#196)

* Initial commit reusing withLDProvider

* Added sitenav. Cleaned up filenames.

* Updated readme with hooks api docs. Fixed linting errors.

* Fixed linting errors.

* Update README.md

* bumping our lerna version to resolve transitive dependency vulnerabilities with fstream and tar (#198)

* fix goals query logic for Electron, also fix handling of invalid content type

* add ability to alter URL in events

* Update browserPlatform definition to detect when an EventSource
polyfill is available and has published that it supports setting the
method used for the stream. When this is the case, the platform
publishes that it supports using REPORT with EventSource and will
provide the polyfill implementation if the SDK attempts a EventSource
connection with the method set to REPORT.

* Fix initial linter warnings.

* Fix another linter warning.

* fix a broken readme link (#202)

* removing a stray character in the readme

* fix stream reconnect logic and add stream connection logging

* linter

* assume logger always exists, as we do in other components

* fix and simplify how the logger object is passed around

* make it so eventUrlTransformer actually does something

* linter

* copy flags object to prevent subtle update problem in Electron

* additional fix + test

* make bootstrapped flags available immediately

* Refactor some of the EventSource constructor selection logic.

* Change browserPlatform.js to check config options when determining
EventSource implementation to use. Added tests for EventSource factory
in browserPlatform.js

* Deal with linter.

* change how supported options are detected in EventSource polyfill

* fix broken homepage attributes (#209)

* improve bad initialization messages (#210)

* improve bad initialization messages

* remove the spaces

* fixing a broken link in a logged message (#212)

* add jsdelivr attribute to js packages (#213)

* adding an option to disable the camel-casing of flag keys (#214)

* adding an option disabling the camel-casing of flag keys

* update comment

* update comment

* fix linter errors

* address pr feedback

* updated readme

* [ch45487] useCamelCaseFlagKeys option (#215)

* Initial commit

* Update initLDClient.ts

* PR fixes. Added prettier.

* Update withLDProvider.test.tsx

* Fixed lint errors. Added test for useCamelCase false on server changes.

* Removed prettier.

* Re-added prettier

* Update yarn.lock

* Update prettier and lock files.

* Fixed more linting issues.

* fix a typo

* use persistent anonymous user logic by default in react sdk (#216)

* use persistent anonymous user logic by default in react sdk

* added a comment

* minor test change

* missed a line

* remove React package from monorepo

* make link text match link

* improve log format and add configurable prefix

* fix test

* linter

* deprecate samplingInterval

* linter

* improve log message for stream connection failures (#221)

* improve log message for stream connection failures

* update the reconnection warning so that it only displays for the first set of each reconnection attempts

* also test that the original put is getting called

* updating tests

* updating tests

* Revert "updating tests"

This reverts commit 84163cdf8b5af6a6e969d777b946a8a2973919ed.

* better abstraction

* minor change

* updating the js-common readme to mention client-side node (#222)

* remove common package, no more monorepo

* add Releaser metadata

* npm audit fix

* unify Rollup config

* migrate new demo code to new package structure

* moved example folder

* syntax fix in demo

* fix directory name

* fix linting

* use spread operator instead of Object.assign

* don't close client on beforeunload, but do flush events

* typo

* clarify test postconditions

* misc test app improvements for testing beforeunload handler

* rm unused yarn.lock

* rm typedoc dependency, don't commit installation of it during release

* fix paths

* fix file copying logic

* pr template

* revert

* fix programmatically reported version string

* upgrade Typescript to avoid Typedoc incompatibility

* Revert "upgrade Typescript to avoid Typedoc incompatibility"

This reverts commit 34d9a0f.

* update Babel, Jest, Rollup

* remove old releaser (#229)

* remove unused Rollup plugins, update dependencies

* use new config validation mechanism in js-sdk-common 3.x

* add image-loading event delivery logic factored out of js-sdk-common

* enable diagnostic events in JS SDK

* lint

* fix tests

* use common 3.0.0-beta2

* use 3.1.0-beta3, fix property name

* lint

* use js-sdk-common 3.1.0

* use js-sdk-common 3.1.1 for event payload ID fix

* use js-sdk-common 3.1.2 and loosen our other dependency

* fix license

* use js-sdk-common 3.2.0-beta1

* SDK name should be js-client-sdk

* misc fixes

* use js-sdk-common 3.2.0

* use js-sdk-common 3.2.0

* standardize linting

* use js-sdk-common 3.2.1

* use js-sdk-common 3.2.2

* update package-lock

* update js-sdk-common dependency for initialization error bugfix

* update js-sdk-common for content type bugfix; update some dev dependencies

* remove unsafe usage of hasOwnProperty

* use js-sdk-common 3.2.5

* resolve security vulnerability in acorn dependency (#240)

* update js-sdk-common to get console logging IE bugfix

* update js-sdk-common for duplicate diagnostic event fix

* update js-sdk-common for TS decl fix, improve TS compilation test (#243)

* bump to 3.2.9 to get startsWith fix (#244)

* add option to disable sync event flush (#245)

* update js-sdk-common + some dev dependencies

* No longer remove non-section hash in substring and regex matching

* linting

* the linting target to run in CI is "lint:all", not "lint"

* new js-common-sdk version (#249)

* resolve node-notifier vulnerability by updating jest dep (#250)

* adding contextKind to goal events, bumping js-common to get alias function (#251)

* pin typedoc to unblock our releases (#252)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-sdk-common

* Update common JS SDK library to use fixes for debug event generation issues.

* Update package lock.

* use Releaser v2 config + newer CI image (#256)

* Updated readme headers (#258)

* don't log a warning about custom goal being unknown

* lint + comment

* Release js-client-sdk with the header transformation change

* Updates docs link

* bump js-sdk-common version for better localstorage error handling

* Update launchdarkly-js-sdk-common for JSON error handling fix (sc-142333)

* update lockfile

* add basicLogger export

* Update common for application tags support. (#265)

* Re-remove package-lock.json and add it to the .gitignore. (#266)

* Use a combination of dependencies that is compatible. (#269) (#270)

* Update js-sdk-common to 3.7.0 (#271)

* Update node version used during release. (#272)

* Update common to 3.8.1 (#273)

Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Zach Davis <zach@launchdarkly.com>
Co-authored-by: Elliot <35050275+Apache-HB@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Oct 20, 2022
* fixing merge error

* fixing merge error

* fix broken links on npmjs.com (#193)

* update lockfiles for new packages

* fix changelog formatting error that messes up the release script

* Specify unpkg default target file in package.json for
launchdarkly-js-client-sdk and launchdarkly-js-sdk-common.

* Correct requestor call to fetch flags on a received ping event.

* Implement Hooks API (#196)

* Initial commit reusing withLDProvider

* Added sitenav. Cleaned up filenames.

* Updated readme with hooks api docs. Fixed linting errors.

* Fixed linting errors.

* Update README.md

* bumping our lerna version to resolve transitive dependency vulnerabilities with fstream and tar (#198)

* fix goals query logic for Electron, also fix handling of invalid content type

* add ability to alter URL in events

* Update browserPlatform definition to detect when an EventSource
polyfill is available and has published that it supports setting the
method used for the stream. When this is the case, the platform
publishes that it supports using REPORT with EventSource and will
provide the polyfill implementation if the SDK attempts a EventSource
connection with the method set to REPORT.

* Fix initial linter warnings.

* Fix another linter warning.

* fix a broken readme link (#202)

* removing a stray character in the readme

* fix stream reconnect logic and add stream connection logging

* linter

* assume logger always exists, as we do in other components

* fix and simplify how the logger object is passed around

* make it so eventUrlTransformer actually does something

* linter

* copy flags object to prevent subtle update problem in Electron

* additional fix + test

* make bootstrapped flags available immediately

* Refactor some of the EventSource constructor selection logic.

* Change browserPlatform.js to check config options when determining
EventSource implementation to use. Added tests for EventSource factory
in browserPlatform.js

* Deal with linter.

* change how supported options are detected in EventSource polyfill

* fix broken homepage attributes (#209)

* improve bad initialization messages (#210)

* improve bad initialization messages

* remove the spaces

* fixing a broken link in a logged message (#212)

* add jsdelivr attribute to js packages (#213)

* adding an option to disable the camel-casing of flag keys (#214)

* adding an option disabling the camel-casing of flag keys

* update comment

* update comment

* fix linter errors

* address pr feedback

* updated readme

* [ch45487] useCamelCaseFlagKeys option (#215)

* Initial commit

* Update initLDClient.ts

* PR fixes. Added prettier.

* Update withLDProvider.test.tsx

* Fixed lint errors. Added test for useCamelCase false on server changes.

* Removed prettier.

* Re-added prettier

* Update yarn.lock

* Update prettier and lock files.

* Fixed more linting issues.

* fix a typo

* use persistent anonymous user logic by default in react sdk (#216)

* use persistent anonymous user logic by default in react sdk

* added a comment

* minor test change

* missed a line

* remove React package from monorepo

* make link text match link

* improve log format and add configurable prefix

* fix test

* linter

* deprecate samplingInterval

* linter

* improve log message for stream connection failures (#221)

* improve log message for stream connection failures

* update the reconnection warning so that it only displays for the first set of each reconnection attempts

* also test that the original put is getting called

* updating tests

* updating tests

* Revert "updating tests"

This reverts commit 84163cdf8b5af6a6e969d777b946a8a2973919ed.

* better abstraction

* minor change

* updating the js-common readme to mention client-side node (#222)

* remove common package, no more monorepo

* add Releaser metadata

* npm audit fix

* unify Rollup config

* migrate new demo code to new package structure

* moved example folder

* syntax fix in demo

* fix directory name

* fix linting

* use spread operator instead of Object.assign

* don't close client on beforeunload, but do flush events

* typo

* clarify test postconditions

* misc test app improvements for testing beforeunload handler

* rm unused yarn.lock

* rm typedoc dependency, don't commit installation of it during release

* fix paths

* fix file copying logic

* pr template

* revert

* fix programmatically reported version string

* upgrade Typescript to avoid Typedoc incompatibility

* Revert "upgrade Typescript to avoid Typedoc incompatibility"

This reverts commit 34d9a0f.

* update Babel, Jest, Rollup

* remove old releaser (#229)

* remove unused Rollup plugins, update dependencies

* use new config validation mechanism in js-sdk-common 3.x

* add image-loading event delivery logic factored out of js-sdk-common

* enable diagnostic events in JS SDK

* lint

* fix tests

* use common 3.0.0-beta2

* use 3.1.0-beta3, fix property name

* lint

* use js-sdk-common 3.1.0

* use js-sdk-common 3.1.1 for event payload ID fix

* use js-sdk-common 3.1.2 and loosen our other dependency

* fix license

* use js-sdk-common 3.2.0-beta1

* SDK name should be js-client-sdk

* misc fixes

* use js-sdk-common 3.2.0

* use js-sdk-common 3.2.0

* standardize linting

* use js-sdk-common 3.2.1

* use js-sdk-common 3.2.2

* update package-lock

* update js-sdk-common dependency for initialization error bugfix

* update js-sdk-common for content type bugfix; update some dev dependencies

* remove unsafe usage of hasOwnProperty

* use js-sdk-common 3.2.5

* resolve security vulnerability in acorn dependency (#240)

* update js-sdk-common to get console logging IE bugfix

* update js-sdk-common for duplicate diagnostic event fix

* update js-sdk-common for TS decl fix, improve TS compilation test (#243)

* bump to 3.2.9 to get startsWith fix (#244)

* add option to disable sync event flush (#245)

* update js-sdk-common + some dev dependencies

* No longer remove non-section hash in substring and regex matching

* linting

* the linting target to run in CI is "lint:all", not "lint"

* new js-common-sdk version (#249)

* resolve node-notifier vulnerability by updating jest dep (#250)

* adding contextKind to goal events, bumping js-common to get alias function (#251)

* pin typedoc to unblock our releases (#252)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-sdk-common

* Update common JS SDK library to use fixes for debug event generation issues.

* Update package lock.

* use Releaser v2 config + newer CI image (#256)

* Updated readme headers (#258)

* don't log a warning about custom goal being unknown

* lint + comment

* Release js-client-sdk with the header transformation change

* Updates docs link

* bump js-sdk-common version for better localstorage error handling

* Update launchdarkly-js-sdk-common for JSON error handling fix (sc-142333)

* update lockfile

* add basicLogger export

* Update common for application tags support. (#265)

* Re-remove package-lock.json and add it to the .gitignore. (#266)

* Use a combination of dependencies that is compatible. (#269) (#270)

* Update js-sdk-common to 3.7.0 (#271)

* Update node version used during release. (#272)

* Update common to 3.8.1 (#273)

* Update common version for jitter and backoff. (#274)

Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Zach Davis <zach@launchdarkly.com>
Co-authored-by: Elliot <35050275+Apache-HB@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Oct 20, 2022
* fixing merge error

* fixing merge error

* fix broken links on npmjs.com (#193)

* update lockfiles for new packages

* fix changelog formatting error that messes up the release script

* Specify unpkg default target file in package.json for
launchdarkly-js-client-sdk and launchdarkly-js-sdk-common.

* Correct requestor call to fetch flags on a received ping event.

* Implement Hooks API (#196)

* Initial commit reusing withLDProvider

* Added sitenav. Cleaned up filenames.

* Updated readme with hooks api docs. Fixed linting errors.

* Fixed linting errors.

* Update README.md

* bumping our lerna version to resolve transitive dependency vulnerabilities with fstream and tar (#198)

* fix goals query logic for Electron, also fix handling of invalid content type

* add ability to alter URL in events

* Update browserPlatform definition to detect when an EventSource
polyfill is available and has published that it supports setting the
method used for the stream. When this is the case, the platform
publishes that it supports using REPORT with EventSource and will
provide the polyfill implementation if the SDK attempts a EventSource
connection with the method set to REPORT.

* Fix initial linter warnings.

* Fix another linter warning.

* fix a broken readme link (#202)

* removing a stray character in the readme

* fix stream reconnect logic and add stream connection logging

* linter

* assume logger always exists, as we do in other components

* fix and simplify how the logger object is passed around

* make it so eventUrlTransformer actually does something

* linter

* copy flags object to prevent subtle update problem in Electron

* additional fix + test

* make bootstrapped flags available immediately

* Refactor some of the EventSource constructor selection logic.

* Change browserPlatform.js to check config options when determining
EventSource implementation to use. Added tests for EventSource factory
in browserPlatform.js

* Deal with linter.

* change how supported options are detected in EventSource polyfill

* fix broken homepage attributes (#209)

* improve bad initialization messages (#210)

* improve bad initialization messages

* remove the spaces

* fixing a broken link in a logged message (#212)

* add jsdelivr attribute to js packages (#213)

* adding an option to disable the camel-casing of flag keys (#214)

* adding an option disabling the camel-casing of flag keys

* update comment

* update comment

* fix linter errors

* address pr feedback

* updated readme

* [ch45487] useCamelCaseFlagKeys option (#215)

* Initial commit

* Update initLDClient.ts

* PR fixes. Added prettier.

* Update withLDProvider.test.tsx

* Fixed lint errors. Added test for useCamelCase false on server changes.

* Removed prettier.

* Re-added prettier

* Update yarn.lock

* Update prettier and lock files.

* Fixed more linting issues.

* fix a typo

* use persistent anonymous user logic by default in react sdk (#216)

* use persistent anonymous user logic by default in react sdk

* added a comment

* minor test change

* missed a line

* remove React package from monorepo

* make link text match link

* improve log format and add configurable prefix

* fix test

* linter

* deprecate samplingInterval

* linter

* improve log message for stream connection failures (#221)

* improve log message for stream connection failures

* update the reconnection warning so that it only displays for the first set of each reconnection attempts

* also test that the original put is getting called

* updating tests

* updating tests

* Revert "updating tests"

This reverts commit 84163cdf8b5af6a6e969d777b946a8a2973919ed.

* better abstraction

* minor change

* updating the js-common readme to mention client-side node (#222)

* remove common package, no more monorepo

* add Releaser metadata

* npm audit fix

* unify Rollup config

* migrate new demo code to new package structure

* moved example folder

* syntax fix in demo

* fix directory name

* fix linting

* use spread operator instead of Object.assign

* don't close client on beforeunload, but do flush events

* typo

* clarify test postconditions

* misc test app improvements for testing beforeunload handler

* rm unused yarn.lock

* rm typedoc dependency, don't commit installation of it during release

* fix paths

* fix file copying logic

* pr template

* revert

* fix programmatically reported version string

* upgrade Typescript to avoid Typedoc incompatibility

* Revert "upgrade Typescript to avoid Typedoc incompatibility"

This reverts commit 34d9a0f.

* update Babel, Jest, Rollup

* remove old releaser (#229)

* remove unused Rollup plugins, update dependencies

* use new config validation mechanism in js-sdk-common 3.x

* add image-loading event delivery logic factored out of js-sdk-common

* enable diagnostic events in JS SDK

* lint

* fix tests

* use common 3.0.0-beta2

* use 3.1.0-beta3, fix property name

* lint

* use js-sdk-common 3.1.0

* use js-sdk-common 3.1.1 for event payload ID fix

* use js-sdk-common 3.1.2 and loosen our other dependency

* fix license

* use js-sdk-common 3.2.0-beta1

* SDK name should be js-client-sdk

* misc fixes

* use js-sdk-common 3.2.0

* use js-sdk-common 3.2.0

* standardize linting

* use js-sdk-common 3.2.1

* use js-sdk-common 3.2.2

* update package-lock

* update js-sdk-common dependency for initialization error bugfix

* update js-sdk-common for content type bugfix; update some dev dependencies

* remove unsafe usage of hasOwnProperty

* use js-sdk-common 3.2.5

* resolve security vulnerability in acorn dependency (#240)

* update js-sdk-common to get console logging IE bugfix

* update js-sdk-common for duplicate diagnostic event fix

* update js-sdk-common for TS decl fix, improve TS compilation test (#243)

* bump to 3.2.9 to get startsWith fix (#244)

* add option to disable sync event flush (#245)

* update js-sdk-common + some dev dependencies

* No longer remove non-section hash in substring and regex matching

* linting

* the linting target to run in CI is "lint:all", not "lint"

* new js-common-sdk version (#249)

* resolve node-notifier vulnerability by updating jest dep (#250)

* adding contextKind to goal events, bumping js-common to get alias function (#251)

* pin typedoc to unblock our releases (#252)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-sdk-common

* Update common JS SDK library to use fixes for debug event generation issues.

* Update package lock.

* use Releaser v2 config + newer CI image (#256)

* Updated readme headers (#258)

* don't log a warning about custom goal being unknown

* lint + comment

* Release js-client-sdk with the header transformation change

* Updates docs link

* bump js-sdk-common version for better localstorage error handling

* Update launchdarkly-js-sdk-common for JSON error handling fix (sc-142333)

* update lockfile

* add basicLogger export

* Update common for application tags support. (#265)

* Re-remove package-lock.json and add it to the .gitignore. (#266)

* Use a combination of dependencies that is compatible. (#269) (#270)

* Update js-sdk-common to 3.7.0 (#271)

* Update node version used during release. (#272)

* Update common to 3.8.1 (#273)

* Update common version for jitter and backoff. (#274)

* Update typedoc and make associated documentation changes. (#275)

Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Zach Davis <zach@launchdarkly.com>
Co-authored-by: Elliot <35050275+Apache-HB@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Dec 7, 2022
* bumping our lerna version to resolve transitive dependency vulnerabilities with fstream and tar (#198)

* fix goals query logic for Electron, also fix handling of invalid content type

* add ability to alter URL in events

* Update browserPlatform definition to detect when an EventSource
polyfill is available and has published that it supports setting the
method used for the stream. When this is the case, the platform
publishes that it supports using REPORT with EventSource and will
provide the polyfill implementation if the SDK attempts a EventSource
connection with the method set to REPORT.

* Fix initial linter warnings.

* Fix another linter warning.

* fix a broken readme link (#202)

* removing a stray character in the readme

* fix stream reconnect logic and add stream connection logging

* linter

* assume logger always exists, as we do in other components

* fix and simplify how the logger object is passed around

* make it so eventUrlTransformer actually does something

* linter

* copy flags object to prevent subtle update problem in Electron

* additional fix + test

* make bootstrapped flags available immediately

* Refactor some of the EventSource constructor selection logic.

* Change browserPlatform.js to check config options when determining
EventSource implementation to use. Added tests for EventSource factory
in browserPlatform.js

* Deal with linter.

* change how supported options are detected in EventSource polyfill

* fix broken homepage attributes (#209)

* improve bad initialization messages (#210)

* improve bad initialization messages

* remove the spaces

* fixing a broken link in a logged message (#212)

* add jsdelivr attribute to js packages (#213)

* adding an option to disable the camel-casing of flag keys (#214)

* adding an option disabling the camel-casing of flag keys

* update comment

* update comment

* fix linter errors

* address pr feedback

* updated readme

* [ch45487] useCamelCaseFlagKeys option (#215)

* Initial commit

* Update initLDClient.ts

* PR fixes. Added prettier.

* Update withLDProvider.test.tsx

* Fixed lint errors. Added test for useCamelCase false on server changes.

* Removed prettier.

* Re-added prettier

* Update yarn.lock

* Update prettier and lock files.

* Fixed more linting issues.

* fix a typo

* use persistent anonymous user logic by default in react sdk (#216)

* use persistent anonymous user logic by default in react sdk

* added a comment

* minor test change

* missed a line

* remove React package from monorepo

* make link text match link

* improve log format and add configurable prefix

* fix test

* linter

* deprecate samplingInterval

* linter

* improve log message for stream connection failures (#221)

* improve log message for stream connection failures

* update the reconnection warning so that it only displays for the first set of each reconnection attempts

* also test that the original put is getting called

* updating tests

* updating tests

* Revert "updating tests"

This reverts commit 84163cdf8b5af6a6e969d777b946a8a2973919ed.

* better abstraction

* minor change

* updating the js-common readme to mention client-side node (#222)

* remove common package, no more monorepo

* add Releaser metadata

* npm audit fix

* unify Rollup config

* migrate new demo code to new package structure

* moved example folder

* syntax fix in demo

* fix directory name

* fix linting

* use spread operator instead of Object.assign

* don't close client on beforeunload, but do flush events

* typo

* clarify test postconditions

* misc test app improvements for testing beforeunload handler

* rm unused yarn.lock

* rm typedoc dependency, don't commit installation of it during release

* fix paths

* fix file copying logic

* pr template

* revert

* fix programmatically reported version string

* upgrade Typescript to avoid Typedoc incompatibility

* Revert "upgrade Typescript to avoid Typedoc incompatibility"

This reverts commit 34d9a0f.

* update Babel, Jest, Rollup

* remove old releaser (#229)

* remove unused Rollup plugins, update dependencies

* use new config validation mechanism in js-sdk-common 3.x

* add image-loading event delivery logic factored out of js-sdk-common

* enable diagnostic events in JS SDK

* lint

* fix tests

* use common 3.0.0-beta2

* use 3.1.0-beta3, fix property name

* lint

* use js-sdk-common 3.1.0

* use js-sdk-common 3.1.1 for event payload ID fix

* use js-sdk-common 3.1.2 and loosen our other dependency

* fix license

* use js-sdk-common 3.2.0-beta1

* SDK name should be js-client-sdk

* misc fixes

* use js-sdk-common 3.2.0

* use js-sdk-common 3.2.0

* standardize linting

* use js-sdk-common 3.2.1

* use js-sdk-common 3.2.2

* update package-lock

* update js-sdk-common dependency for initialization error bugfix

* update js-sdk-common for content type bugfix; update some dev dependencies

* remove unsafe usage of hasOwnProperty

* use js-sdk-common 3.2.5

* resolve security vulnerability in acorn dependency (#240)

* update js-sdk-common to get console logging IE bugfix

* update js-sdk-common for duplicate diagnostic event fix

* update js-sdk-common for TS decl fix, improve TS compilation test (#243)

* bump to 3.2.9 to get startsWith fix (#244)

* add option to disable sync event flush (#245)

* update js-sdk-common + some dev dependencies

* No longer remove non-section hash in substring and regex matching

* linting

* the linting target to run in CI is "lint:all", not "lint"

* new js-common-sdk version (#249)

* resolve node-notifier vulnerability by updating jest dep (#250)

* adding contextKind to goal events, bumping js-common to get alias function (#251)

* pin typedoc to unblock our releases (#252)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-sdk-common

* Update common JS SDK library to use fixes for debug event generation issues.

* Update package lock.

* use Releaser v2 config + newer CI image (#256)

* Updated readme headers (#258)

* don't log a warning about custom goal being unknown

* lint + comment

* Release js-client-sdk with the header transformation change

* Updates docs link

* bump js-sdk-common version for better localstorage error handling

* Update launchdarkly-js-sdk-common for JSON error handling fix (sc-142333)

* update lockfile

* add basicLogger export

* Update common for application tags support. (#265)

* Re-remove package-lock.json and add it to the .gitignore. (#266)

* Switch to 5.0 of the SDK common.

* Use a combination of dependencies that is compatible. (#269)

* Use a combination of dependencies that is compatible. (#269) (#270)

* Update js-sdk-common to 3.7.0 (#271)

* Update node version used during release. (#272)

* Update common to 3.8.1 (#273)

* Update common version for jitter and backoff. (#274)

* Update typedoc and make associated documentation changes. (#275)

* Update to prerelease package. (#276)

* Update release config to use node 14.

* Update typedoc and make associated documentation changes. (#275) (#277)

* Update to pre-release common 5.0.0-alpha.2

* Update typings.d.ts (#278)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update to js-sdk-common 5.0.0-alpha.3

* [sc-177790] Replaced getUser with getContext (#279)

* Replaced getUser with getContext

* Remove contextKind

* Update GoalManager.js

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js (#280)

* Switch to 5.0 of the SDK common.

* Use a combination of dependencies that is compatible. (#269)

* Update to prerelease package. (#276)

* Update release config to use node 14.

* Update typedoc and make associated documentation changes. (#275) (#277)

* Update to pre-release common 5.0.0-alpha.2

* Update typings.d.ts (#278)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update to js-sdk-common 5.0.0-alpha.3

* [sc-177790] Replaced getUser with getContext (#279)

* Replaced getUser with getContext

* Remove contextKind

* Update GoalManager.js

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js

Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js (#281)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update SDK common version. (#282)

* Update release metadata.

Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: Zach Davis <zach@launchdarkly.com>
Co-authored-by: Elliot <35050275+Apache-HB@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Jan 18, 2023
* add ability to alter URL in events

* Update browserPlatform definition to detect when an EventSource
polyfill is available and has published that it supports setting the
method used for the stream. When this is the case, the platform
publishes that it supports using REPORT with EventSource and will
provide the polyfill implementation if the SDK attempts a EventSource
connection with the method set to REPORT.

* Fix initial linter warnings.

* Fix another linter warning.

* fix a broken readme link (#202)

* removing a stray character in the readme

* fix stream reconnect logic and add stream connection logging

* linter

* assume logger always exists, as we do in other components

* fix and simplify how the logger object is passed around

* make it so eventUrlTransformer actually does something

* linter

* copy flags object to prevent subtle update problem in Electron

* additional fix + test

* make bootstrapped flags available immediately

* Refactor some of the EventSource constructor selection logic.

* Change browserPlatform.js to check config options when determining
EventSource implementation to use. Added tests for EventSource factory
in browserPlatform.js

* Deal with linter.

* change how supported options are detected in EventSource polyfill

* fix broken homepage attributes (#209)

* improve bad initialization messages (#210)

* improve bad initialization messages

* remove the spaces

* fixing a broken link in a logged message (#212)

* add jsdelivr attribute to js packages (#213)

* adding an option to disable the camel-casing of flag keys (#214)

* adding an option disabling the camel-casing of flag keys

* update comment

* update comment

* fix linter errors

* address pr feedback

* updated readme

* [ch45487] useCamelCaseFlagKeys option (#215)

* Initial commit

* Update initLDClient.ts

* PR fixes. Added prettier.

* Update withLDProvider.test.tsx

* Fixed lint errors. Added test for useCamelCase false on server changes.

* Removed prettier.

* Re-added prettier

* Update yarn.lock

* Update prettier and lock files.

* Fixed more linting issues.

* fix a typo

* use persistent anonymous user logic by default in react sdk (#216)

* use persistent anonymous user logic by default in react sdk

* added a comment

* minor test change

* missed a line

* remove React package from monorepo

* make link text match link

* improve log format and add configurable prefix

* fix test

* linter

* deprecate samplingInterval

* linter

* improve log message for stream connection failures (#221)

* improve log message for stream connection failures

* update the reconnection warning so that it only displays for the first set of each reconnection attempts

* also test that the original put is getting called

* updating tests

* updating tests

* Revert "updating tests"

This reverts commit 84163cdf8b5af6a6e969d777b946a8a2973919ed.

* better abstraction

* minor change

* updating the js-common readme to mention client-side node (#222)

* remove common package, no more monorepo

* add Releaser metadata

* npm audit fix

* unify Rollup config

* migrate new demo code to new package structure

* moved example folder

* syntax fix in demo

* fix directory name

* fix linting

* use spread operator instead of Object.assign

* don't close client on beforeunload, but do flush events

* typo

* clarify test postconditions

* misc test app improvements for testing beforeunload handler

* rm unused yarn.lock

* rm typedoc dependency, don't commit installation of it during release

* fix paths

* fix file copying logic

* pr template

* revert

* fix programmatically reported version string

* upgrade Typescript to avoid Typedoc incompatibility

* Revert "upgrade Typescript to avoid Typedoc incompatibility"

This reverts commit 34d9a0f.

* update Babel, Jest, Rollup

* remove old releaser (#229)

* remove unused Rollup plugins, update dependencies

* use new config validation mechanism in js-sdk-common 3.x

* add image-loading event delivery logic factored out of js-sdk-common

* enable diagnostic events in JS SDK

* lint

* fix tests

* use common 3.0.0-beta2

* use 3.1.0-beta3, fix property name

* lint

* use js-sdk-common 3.1.0

* use js-sdk-common 3.1.1 for event payload ID fix

* use js-sdk-common 3.1.2 and loosen our other dependency

* fix license

* use js-sdk-common 3.2.0-beta1

* SDK name should be js-client-sdk

* misc fixes

* use js-sdk-common 3.2.0

* use js-sdk-common 3.2.0

* standardize linting

* use js-sdk-common 3.2.1

* use js-sdk-common 3.2.2

* update package-lock

* update js-sdk-common dependency for initialization error bugfix

* update js-sdk-common for content type bugfix; update some dev dependencies

* remove unsafe usage of hasOwnProperty

* use js-sdk-common 3.2.5

* resolve security vulnerability in acorn dependency (#240)

* update js-sdk-common to get console logging IE bugfix

* update js-sdk-common for duplicate diagnostic event fix

* update js-sdk-common for TS decl fix, improve TS compilation test (#243)

* bump to 3.2.9 to get startsWith fix (#244)

* add option to disable sync event flush (#245)

* update js-sdk-common + some dev dependencies

* No longer remove non-section hash in substring and regex matching

* linting

* the linting target to run in CI is "lint:all", not "lint"

* new js-common-sdk version (#249)

* resolve node-notifier vulnerability by updating jest dep (#250)

* adding contextKind to goal events, bumping js-common to get alias function (#251)

* pin typedoc to unblock our releases (#252)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-sdk-common

* Update common JS SDK library to use fixes for debug event generation issues.

* Update package lock.

* use Releaser v2 config + newer CI image (#256)

* Updated readme headers (#258)

* don't log a warning about custom goal being unknown

* lint + comment

* Release js-client-sdk with the header transformation change

* Updates docs link

* bump js-sdk-common version for better localstorage error handling

* Update launchdarkly-js-sdk-common for JSON error handling fix (sc-142333)

* update lockfile

* add basicLogger export

* Update common for application tags support. (#265)

* Re-remove package-lock.json and add it to the .gitignore. (#266)

* Switch to 5.0 of the SDK common.

* Use a combination of dependencies that is compatible. (#269)

* Use a combination of dependencies that is compatible. (#269) (#270)

* Update js-sdk-common to 3.7.0 (#271)

* Update node version used during release. (#272)

* Update common to 3.8.1 (#273)

* Update common version for jitter and backoff. (#274)

* Update typedoc and make associated documentation changes. (#275)

* Update to prerelease package. (#276)

* Update release config to use node 14.

* Update typedoc and make associated documentation changes. (#275) (#277)

* Update to pre-release common 5.0.0-alpha.2

* Update typings.d.ts (#278)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update to js-sdk-common 5.0.0-alpha.3

* [sc-177790] Replaced getUser with getContext (#279)

* Replaced getUser with getContext

* Remove contextKind

* Update GoalManager.js

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js (#280)

* Switch to 5.0 of the SDK common.

* Use a combination of dependencies that is compatible. (#269)

* Update to prerelease package. (#276)

* Update release config to use node 14.

* Update typedoc and make associated documentation changes. (#275) (#277)

* Update to pre-release common 5.0.0-alpha.2

* Update typings.d.ts (#278)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update to js-sdk-common 5.0.0-alpha.3

* [sc-177790] Replaced getUser with getContext (#279)

* Replaced getUser with getContext

* Remove contextKind

* Update GoalManager.js

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js

Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js (#281)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update SDK common version. (#282)

* Update release metadata.

* Refactor to use page visibility instead of unload/beforeunload. (#267)

* Upgrade JS SDK common to 5.0.1 for documentation fixes. (#283)

* Correcting documentation on visibility handler.

Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: Zach Davis <zach@launchdarkly.com>
Co-authored-by: Elliot <35050275+Apache-HB@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Feb 15, 2023
* Update browserPlatform definition to detect when an EventSource
polyfill is available and has published that it supports setting the
method used for the stream. When this is the case, the platform
publishes that it supports using REPORT with EventSource and will
provide the polyfill implementation if the SDK attempts a EventSource
connection with the method set to REPORT.

* Fix initial linter warnings.

* Fix another linter warning.

* fix a broken readme link (#202)

* removing a stray character in the readme

* fix stream reconnect logic and add stream connection logging

* linter

* assume logger always exists, as we do in other components

* fix and simplify how the logger object is passed around

* make it so eventUrlTransformer actually does something

* linter

* copy flags object to prevent subtle update problem in Electron

* additional fix + test

* make bootstrapped flags available immediately

* Refactor some of the EventSource constructor selection logic.

* Change browserPlatform.js to check config options when determining
EventSource implementation to use. Added tests for EventSource factory
in browserPlatform.js

* Deal with linter.

* change how supported options are detected in EventSource polyfill

* fix broken homepage attributes (#209)

* improve bad initialization messages (#210)

* improve bad initialization messages

* remove the spaces

* fixing a broken link in a logged message (#212)

* add jsdelivr attribute to js packages (#213)

* adding an option to disable the camel-casing of flag keys (#214)

* adding an option disabling the camel-casing of flag keys

* update comment

* update comment

* fix linter errors

* address pr feedback

* updated readme

* [ch45487] useCamelCaseFlagKeys option (#215)

* Initial commit

* Update initLDClient.ts

* PR fixes. Added prettier.

* Update withLDProvider.test.tsx

* Fixed lint errors. Added test for useCamelCase false on server changes.

* Removed prettier.

* Re-added prettier

* Update yarn.lock

* Update prettier and lock files.

* Fixed more linting issues.

* fix a typo

* use persistent anonymous user logic by default in react sdk (#216)

* use persistent anonymous user logic by default in react sdk

* added a comment

* minor test change

* missed a line

* remove React package from monorepo

* make link text match link

* improve log format and add configurable prefix

* fix test

* linter

* deprecate samplingInterval

* linter

* improve log message for stream connection failures (#221)

* improve log message for stream connection failures

* update the reconnection warning so that it only displays for the first set of each reconnection attempts

* also test that the original put is getting called

* updating tests

* updating tests

* Revert "updating tests"

This reverts commit 84163cdf8b5af6a6e969d777b946a8a2973919ed.

* better abstraction

* minor change

* updating the js-common readme to mention client-side node (#222)

* remove common package, no more monorepo

* add Releaser metadata

* npm audit fix

* unify Rollup config

* migrate new demo code to new package structure

* moved example folder

* syntax fix in demo

* fix directory name

* fix linting

* use spread operator instead of Object.assign

* don't close client on beforeunload, but do flush events

* typo

* clarify test postconditions

* misc test app improvements for testing beforeunload handler

* rm unused yarn.lock

* rm typedoc dependency, don't commit installation of it during release

* fix paths

* fix file copying logic

* pr template

* revert

* fix programmatically reported version string

* upgrade Typescript to avoid Typedoc incompatibility

* Revert "upgrade Typescript to avoid Typedoc incompatibility"

This reverts commit 34d9a0f.

* update Babel, Jest, Rollup

* remove old releaser (#229)

* remove unused Rollup plugins, update dependencies

* use new config validation mechanism in js-sdk-common 3.x

* add image-loading event delivery logic factored out of js-sdk-common

* enable diagnostic events in JS SDK

* lint

* fix tests

* use common 3.0.0-beta2

* use 3.1.0-beta3, fix property name

* lint

* use js-sdk-common 3.1.0

* use js-sdk-common 3.1.1 for event payload ID fix

* use js-sdk-common 3.1.2 and loosen our other dependency

* fix license

* use js-sdk-common 3.2.0-beta1

* SDK name should be js-client-sdk

* misc fixes

* use js-sdk-common 3.2.0

* use js-sdk-common 3.2.0

* standardize linting

* use js-sdk-common 3.2.1

* use js-sdk-common 3.2.2

* update package-lock

* update js-sdk-common dependency for initialization error bugfix

* update js-sdk-common for content type bugfix; update some dev dependencies

* remove unsafe usage of hasOwnProperty

* use js-sdk-common 3.2.5

* resolve security vulnerability in acorn dependency (#240)

* update js-sdk-common to get console logging IE bugfix

* update js-sdk-common for duplicate diagnostic event fix

* update js-sdk-common for TS decl fix, improve TS compilation test (#243)

* bump to 3.2.9 to get startsWith fix (#244)

* add option to disable sync event flush (#245)

* update js-sdk-common + some dev dependencies

* No longer remove non-section hash in substring and regex matching

* linting

* the linting target to run in CI is "lint:all", not "lint"

* new js-common-sdk version (#249)

* resolve node-notifier vulnerability by updating jest dep (#250)

* adding contextKind to goal events, bumping js-common to get alias function (#251)

* pin typedoc to unblock our releases (#252)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-sdk-common

* Update common JS SDK library to use fixes for debug event generation issues.

* Update package lock.

* use Releaser v2 config + newer CI image (#256)

* Updated readme headers (#258)

* don't log a warning about custom goal being unknown

* lint + comment

* Release js-client-sdk with the header transformation change

* Updates docs link

* bump js-sdk-common version for better localstorage error handling

* Update launchdarkly-js-sdk-common for JSON error handling fix (sc-142333)

* update lockfile

* add basicLogger export

* Update common for application tags support. (#265)

* Re-remove package-lock.json and add it to the .gitignore. (#266)

* Switch to 5.0 of the SDK common.

* Use a combination of dependencies that is compatible. (#269)

* Use a combination of dependencies that is compatible. (#269) (#270)

* Update js-sdk-common to 3.7.0 (#271)

* Update node version used during release. (#272)

* Update common to 3.8.1 (#273)

* Update common version for jitter and backoff. (#274)

* Update typedoc and make associated documentation changes. (#275)

* Update to prerelease package. (#276)

* Update release config to use node 14.

* Update typedoc and make associated documentation changes. (#275) (#277)

* Update to pre-release common 5.0.0-alpha.2

* Update typings.d.ts (#278)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update to js-sdk-common 5.0.0-alpha.3

* [sc-177790] Replaced getUser with getContext (#279)

* Replaced getUser with getContext

* Remove contextKind

* Update GoalManager.js

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js (#280)

* Switch to 5.0 of the SDK common.

* Use a combination of dependencies that is compatible. (#269)

* Update to prerelease package. (#276)

* Update release config to use node 14.

* Update typedoc and make associated documentation changes. (#275) (#277)

* Update to pre-release common 5.0.0-alpha.2

* Update typings.d.ts (#278)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update to js-sdk-common 5.0.0-alpha.3

* [sc-177790] Replaced getUser with getContext (#279)

* Replaced getUser with getContext

* Remove contextKind

* Update GoalManager.js

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js

Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js (#281)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update SDK common version. (#282)

* Update release metadata.

* Refactor to use page visibility instead of unload/beforeunload. (#267)

* Upgrade JS SDK common to 5.0.1 for documentation fixes. (#283)

* Correcting documentation on visibility handler.

* build(deps): Upgrade to common 5.0.2 (#284)

---------

Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: Zach Davis <zach@launchdarkly.com>
Co-authored-by: Elliot <35050275+Apache-HB@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Mar 21, 2023
* Update browserPlatform definition to detect when an EventSource
polyfill is available and has published that it supports setting the
method used for the stream. When this is the case, the platform
publishes that it supports using REPORT with EventSource and will
provide the polyfill implementation if the SDK attempts a EventSource
connection with the method set to REPORT.

* Fix initial linter warnings.

* Fix another linter warning.

* fix a broken readme link (#202)

* removing a stray character in the readme

* fix stream reconnect logic and add stream connection logging

* linter

* assume logger always exists, as we do in other components

* fix and simplify how the logger object is passed around

* make it so eventUrlTransformer actually does something

* linter

* copy flags object to prevent subtle update problem in Electron

* additional fix + test

* make bootstrapped flags available immediately

* Refactor some of the EventSource constructor selection logic.

* Change browserPlatform.js to check config options when determining
EventSource implementation to use. Added tests for EventSource factory
in browserPlatform.js

* Deal with linter.

* change how supported options are detected in EventSource polyfill

* fix broken homepage attributes (#209)

* improve bad initialization messages (#210)

* improve bad initialization messages

* remove the spaces

* fixing a broken link in a logged message (#212)

* add jsdelivr attribute to js packages (#213)

* adding an option to disable the camel-casing of flag keys (#214)

* adding an option disabling the camel-casing of flag keys

* update comment

* update comment

* fix linter errors

* address pr feedback

* updated readme

* [ch45487] useCamelCaseFlagKeys option (#215)

* Initial commit

* Update initLDClient.ts

* PR fixes. Added prettier.

* Update withLDProvider.test.tsx

* Fixed lint errors. Added test for useCamelCase false on server changes.

* Removed prettier.

* Re-added prettier

* Update yarn.lock

* Update prettier and lock files.

* Fixed more linting issues.

* fix a typo

* use persistent anonymous user logic by default in react sdk (#216)

* use persistent anonymous user logic by default in react sdk

* added a comment

* minor test change

* missed a line

* remove React package from monorepo

* make link text match link

* improve log format and add configurable prefix

* fix test

* linter

* deprecate samplingInterval

* linter

* improve log message for stream connection failures (#221)

* improve log message for stream connection failures

* update the reconnection warning so that it only displays for the first set of each reconnection attempts

* also test that the original put is getting called

* updating tests

* updating tests

* Revert "updating tests"

This reverts commit 84163cdf8b5af6a6e969d777b946a8a2973919ed.

* better abstraction

* minor change

* updating the js-common readme to mention client-side node (#222)

* remove common package, no more monorepo

* add Releaser metadata

* npm audit fix

* unify Rollup config

* migrate new demo code to new package structure

* moved example folder

* syntax fix in demo

* fix directory name

* fix linting

* use spread operator instead of Object.assign

* don't close client on beforeunload, but do flush events

* typo

* clarify test postconditions

* misc test app improvements for testing beforeunload handler

* rm unused yarn.lock

* rm typedoc dependency, don't commit installation of it during release

* fix paths

* fix file copying logic

* pr template

* revert

* fix programmatically reported version string

* upgrade Typescript to avoid Typedoc incompatibility

* Revert "upgrade Typescript to avoid Typedoc incompatibility"

This reverts commit 34d9a0f.

* update Babel, Jest, Rollup

* remove old releaser (#229)

* remove unused Rollup plugins, update dependencies

* use new config validation mechanism in js-sdk-common 3.x

* add image-loading event delivery logic factored out of js-sdk-common

* enable diagnostic events in JS SDK

* lint

* fix tests

* use common 3.0.0-beta2

* use 3.1.0-beta3, fix property name

* lint

* use js-sdk-common 3.1.0

* use js-sdk-common 3.1.1 for event payload ID fix

* use js-sdk-common 3.1.2 and loosen our other dependency

* fix license

* use js-sdk-common 3.2.0-beta1

* SDK name should be js-client-sdk

* misc fixes

* use js-sdk-common 3.2.0

* use js-sdk-common 3.2.0

* standardize linting

* use js-sdk-common 3.2.1

* use js-sdk-common 3.2.2

* update package-lock

* update js-sdk-common dependency for initialization error bugfix

* update js-sdk-common for content type bugfix; update some dev dependencies

* remove unsafe usage of hasOwnProperty

* use js-sdk-common 3.2.5

* resolve security vulnerability in acorn dependency (#240)

* update js-sdk-common to get console logging IE bugfix

* update js-sdk-common for duplicate diagnostic event fix

* update js-sdk-common for TS decl fix, improve TS compilation test (#243)

* bump to 3.2.9 to get startsWith fix (#244)

* add option to disable sync event flush (#245)

* update js-sdk-common + some dev dependencies

* No longer remove non-section hash in substring and regex matching

* linting

* the linting target to run in CI is "lint:all", not "lint"

* new js-common-sdk version (#249)

* resolve node-notifier vulnerability by updating jest dep (#250)

* adding contextKind to goal events, bumping js-common to get alias function (#251)

* pin typedoc to unblock our releases (#252)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-sdk-common

* Update common JS SDK library to use fixes for debug event generation issues.

* Update package lock.

* use Releaser v2 config + newer CI image (#256)

* Updated readme headers (#258)

* don't log a warning about custom goal being unknown

* lint + comment

* Release js-client-sdk with the header transformation change

* Updates docs link

* bump js-sdk-common version for better localstorage error handling

* Update launchdarkly-js-sdk-common for JSON error handling fix (sc-142333)

* update lockfile

* add basicLogger export

* Update common for application tags support. (#265)

* Re-remove package-lock.json and add it to the .gitignore. (#266)

* Switch to 5.0 of the SDK common.

* Use a combination of dependencies that is compatible. (#269)

* Use a combination of dependencies that is compatible. (#269) (#270)

* Update js-sdk-common to 3.7.0 (#271)

* Update node version used during release. (#272)

* Update common to 3.8.1 (#273)

* Update common version for jitter and backoff. (#274)

* Update typedoc and make associated documentation changes. (#275)

* Update to prerelease package. (#276)

* Update release config to use node 14.

* Update typedoc and make associated documentation changes. (#275) (#277)

* Update to pre-release common 5.0.0-alpha.2

* Update typings.d.ts (#278)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update to js-sdk-common 5.0.0-alpha.3

* [sc-177790] Replaced getUser with getContext (#279)

* Replaced getUser with getContext

* Remove contextKind

* Update GoalManager.js

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js (#280)

* Switch to 5.0 of the SDK common.

* Use a combination of dependencies that is compatible. (#269)

* Update to prerelease package. (#276)

* Update release config to use node 14.

* Update typedoc and make associated documentation changes. (#275) (#277)

* Update to pre-release common 5.0.0-alpha.2

* Update typings.d.ts (#278)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update to js-sdk-common 5.0.0-alpha.3

* [sc-177790] Replaced getUser with getContext (#279)

* Replaced getUser with getContext

* Remove contextKind

* Update GoalManager.js

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js

Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js (#281)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update SDK common version. (#282)

* Update release metadata.

* Refactor to use page visibility instead of unload/beforeunload. (#267)

* Upgrade JS SDK common to 5.0.1 for documentation fixes. (#283)

* Correcting documentation on visibility handler.

* build(deps): Upgrade to common 5.0.2 (#284)

* build(deps): Update to common 5.0.3 (#285)

---------

Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Zach Davis <zach@launchdarkly.com>
Co-authored-by: Elliot <35050275+Apache-HB@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Apr 12, 2023
* Fix another linter warning.

* fix a broken readme link (#202)

* removing a stray character in the readme

* fix stream reconnect logic and add stream connection logging

* linter

* assume logger always exists, as we do in other components

* fix and simplify how the logger object is passed around

* make it so eventUrlTransformer actually does something

* linter

* copy flags object to prevent subtle update problem in Electron

* additional fix + test

* make bootstrapped flags available immediately

* Refactor some of the EventSource constructor selection logic.

* Change browserPlatform.js to check config options when determining
EventSource implementation to use. Added tests for EventSource factory
in browserPlatform.js

* Deal with linter.

* change how supported options are detected in EventSource polyfill

* fix broken homepage attributes (#209)

* improve bad initialization messages (#210)

* improve bad initialization messages

* remove the spaces

* fixing a broken link in a logged message (#212)

* add jsdelivr attribute to js packages (#213)

* adding an option to disable the camel-casing of flag keys (#214)

* adding an option disabling the camel-casing of flag keys

* update comment

* update comment

* fix linter errors

* address pr feedback

* updated readme

* [ch45487] useCamelCaseFlagKeys option (#215)

* Initial commit

* Update initLDClient.ts

* PR fixes. Added prettier.

* Update withLDProvider.test.tsx

* Fixed lint errors. Added test for useCamelCase false on server changes.

* Removed prettier.

* Re-added prettier

* Update yarn.lock

* Update prettier and lock files.

* Fixed more linting issues.

* fix a typo

* use persistent anonymous user logic by default in react sdk (#216)

* use persistent anonymous user logic by default in react sdk

* added a comment

* minor test change

* missed a line

* remove React package from monorepo

* make link text match link

* improve log format and add configurable prefix

* fix test

* linter

* deprecate samplingInterval

* linter

* improve log message for stream connection failures (#221)

* improve log message for stream connection failures

* update the reconnection warning so that it only displays for the first set of each reconnection attempts

* also test that the original put is getting called

* updating tests

* updating tests

* Revert "updating tests"

This reverts commit 84163cdf8b5af6a6e969d777b946a8a2973919ed.

* better abstraction

* minor change

* updating the js-common readme to mention client-side node (#222)

* remove common package, no more monorepo

* add Releaser metadata

* npm audit fix

* unify Rollup config

* migrate new demo code to new package structure

* moved example folder

* syntax fix in demo

* fix directory name

* fix linting

* use spread operator instead of Object.assign

* don't close client on beforeunload, but do flush events

* typo

* clarify test postconditions

* misc test app improvements for testing beforeunload handler

* rm unused yarn.lock

* rm typedoc dependency, don't commit installation of it during release

* fix paths

* fix file copying logic

* pr template

* revert

* fix programmatically reported version string

* upgrade Typescript to avoid Typedoc incompatibility

* Revert "upgrade Typescript to avoid Typedoc incompatibility"

This reverts commit 34d9a0f.

* update Babel, Jest, Rollup

* remove old releaser (#229)

* remove unused Rollup plugins, update dependencies

* use new config validation mechanism in js-sdk-common 3.x

* add image-loading event delivery logic factored out of js-sdk-common

* enable diagnostic events in JS SDK

* lint

* fix tests

* use common 3.0.0-beta2

* use 3.1.0-beta3, fix property name

* lint

* use js-sdk-common 3.1.0

* use js-sdk-common 3.1.1 for event payload ID fix

* use js-sdk-common 3.1.2 and loosen our other dependency

* fix license

* use js-sdk-common 3.2.0-beta1

* SDK name should be js-client-sdk

* misc fixes

* use js-sdk-common 3.2.0

* use js-sdk-common 3.2.0

* standardize linting

* use js-sdk-common 3.2.1

* use js-sdk-common 3.2.2

* update package-lock

* update js-sdk-common dependency for initialization error bugfix

* update js-sdk-common for content type bugfix; update some dev dependencies

* remove unsafe usage of hasOwnProperty

* use js-sdk-common 3.2.5

* resolve security vulnerability in acorn dependency (#240)

* update js-sdk-common to get console logging IE bugfix

* update js-sdk-common for duplicate diagnostic event fix

* update js-sdk-common for TS decl fix, improve TS compilation test (#243)

* bump to 3.2.9 to get startsWith fix (#244)

* add option to disable sync event flush (#245)

* update js-sdk-common + some dev dependencies

* No longer remove non-section hash in substring and regex matching

* linting

* the linting target to run in CI is "lint:all", not "lint"

* new js-common-sdk version (#249)

* resolve node-notifier vulnerability by updating jest dep (#250)

* adding contextKind to goal events, bumping js-common to get alias function (#251)

* pin typedoc to unblock our releases (#252)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-sdk-common

* Update common JS SDK library to use fixes for debug event generation issues.

* Update package lock.

* use Releaser v2 config + newer CI image (#256)

* Updated readme headers (#258)

* don't log a warning about custom goal being unknown

* lint + comment

* Release js-client-sdk with the header transformation change

* Updates docs link

* bump js-sdk-common version for better localstorage error handling

* Update launchdarkly-js-sdk-common for JSON error handling fix (sc-142333)

* update lockfile

* add basicLogger export

* Update common for application tags support. (#265)

* Re-remove package-lock.json and add it to the .gitignore. (#266)

* Switch to 5.0 of the SDK common.

* Use a combination of dependencies that is compatible. (#269)

* Use a combination of dependencies that is compatible. (#269) (#270)

* Update js-sdk-common to 3.7.0 (#271)

* Update node version used during release. (#272)

* Update common to 3.8.1 (#273)

* Update common version for jitter and backoff. (#274)

* Update typedoc and make associated documentation changes. (#275)

* Update to prerelease package. (#276)

* Update release config to use node 14.

* Update typedoc and make associated documentation changes. (#275) (#277)

* Update to pre-release common 5.0.0-alpha.2

* Update typings.d.ts (#278)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update to js-sdk-common 5.0.0-alpha.3

* [sc-177790] Replaced getUser with getContext (#279)

* Replaced getUser with getContext

* Remove contextKind

* Update GoalManager.js

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js (#280)

* Switch to 5.0 of the SDK common.

* Use a combination of dependencies that is compatible. (#269)

* Update to prerelease package. (#276)

* Update release config to use node 14.

* Update typedoc and make associated documentation changes. (#275) (#277)

* Update to pre-release common 5.0.0-alpha.2

* Update typings.d.ts (#278)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update to js-sdk-common 5.0.0-alpha.3

* [sc-177790] Replaced getUser with getContext (#279)

* Replaced getUser with getContext

* Remove contextKind

* Update GoalManager.js

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js

Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update GoalManager.js (#281)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update SDK common version. (#282)

* Update release metadata.

* Refactor to use page visibility instead of unload/beforeunload. (#267)

* Upgrade JS SDK common to 5.0.1 for documentation fixes. (#283)

* Correcting documentation on visibility handler.

* build(deps): Upgrade to common 5.0.2 (#284)

* build(deps): Update to common 5.0.3 (#285)

---------

Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Zach Davis <zach@launchdarkly.com>
Co-authored-by: Elliot <35050275+Apache-HB@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>
@gautamkr04
Copy link

Hi ,
I have similar issue when we have long lived connection (24hr) observed that flag set to false , and re render for when flag is true. To Work again need to reload the page again.

it is very intuitive to user to observe that next day there are some issue.

const useInitialiseLDContext = () => {
    const { data: userProfile } = useAssumeGetUserProfileInfoQuery();
    let ldClient = useLDClient();
    const storedEmail = localStorage.getItem('email');

    // Initialise when client is available
    useEffect(() => {
        if (ldClient && storedEmail) {
            ldClient.identify(getLDContextObject({ email: storedEmail }));
        }
    }, [ldClient]);

    // change context when email doesn't exists , and company_group_id added.
    useEffect(() => {
        const handleVisibilityChange = () => {
            console.log(document.visibilityState, 'hook visible state');
            if (ldClient) {
                console.log('hook visible state \n', document.visibilityState, '\n hook ldClient', ldClient, '\n context    ', ldClient?.getContext());
            }
            if (document.visibilityState === 'visible' && ldClient) {
                const { email, company_group_id } = userProfile?.data || {};

                // Set email in localStorage if not already set and update to launchdarkly
                if (!storedEmail && email) {
                    localStorage.setItem('email', email);
                    ldClient.identify(getLDContextObject({ email }));
                }

                // Identify the user with the specific company_group_id if available
                if (company_group_id) {
                    const oldContext = ldClient.getContext();
                    ldClient.identify({ ...oldContext, company_group_id });
                }
            }
        };

        document.addEventListener('visibilitychange', handleVisibilityChange);

        return () => {
            document.removeEventListener('visibilitychange', handleVisibilityChange);
        };
    }, [ldClient, userProfile?.data]);
};

**we call it inside App.tsx**
<LDProvider clientSideID={environment.launchDarkly_client_SDK_key}>
     <AppRoutes />
</LDProvider>

**and inside AppRoutes call useInitialiseLDContext **
useInitialiseLDContext();

Can some one please help .

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

No branches or pull requests

4 participants