launchdarkly / js-sdk-common

Code shared between all LaunchDarkly client-side JS-based SDKs
Other
4 stars 27 forks source link

Network requests to fetch flags are not retried unless the client successfully retrieves flags from localStorage #80

Open AumyF opened 2 years ago

AumyF commented 2 years ago

Describe the bug Using js-client-sdk, network requests to fetch flags are not retried unless the client successfully retrieves flags from localStorage.

To reproduce The client retries to fetch flags when it succeeds to bootstrap from localStorage:

  1. Set bootstrap: "localStorage"
  2. Load the application to let the client to store flags in localStorage
  3. Configure to block requests to https://*.launchdarkly.com/* using request blocking of Chrome's request blocking
  4. Reload the application
  5. See that the requests to https://clientstream.launchdarkly.com/eval/* is repeated

Otherwise it does not retries the requests:

  1. Clear localStorage or unset bootstrap option
  2. Configure to block requests to https://*.launchdarkly.com/* using request blocking of Chrome's request blocking
  3. Reload the application
  4. See that the requests is not retried

Expected behavior A client retries network requests even if bootstrap is not set or there is no flags in localStorage.

SDK version js-sdk-common: 3.8.2 js-client-sdk: 2.24.2

Language version, developer tools Chrome 106

OS/platform macOS 12.4

Additional context These lines of code seems to be related.

yusinto commented 2 years ago

Thanks for submitting this issue. We'll take a look.

Filed internally as 176572.