Flagsmith / flagsmith-js-client

Javascript Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/

Home Page:https://www.flagsmith.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flagsmith's 'useFlags' doesn't return actual cached flags when request failed

vik-buchinski opened this issue · comments

Steps to reproduce:

  1. open sandbox example
  2. make sure that flags are loaded and you see rendered 'single_brand.enabled -> true' and 'multi_brand.enabled -> true'
  3. open developer console -> 'Network' tab
  4. find 'https://api.flagsmith.com/api/v1/flags/' request and block it using 'Block request url' feature
  5. refresh rendered view in the sandbox using 'refresh' button

Actual behavior: when we reload the sandbox view, flagsmith sometimes loads flags with 'false' flags and sometimes with actual values from the cache.
Expected behavior: when we reload the sandbox view, flagsmith always loads flags with actual values from the cache.

Attaching gif with the reproduced issue:
flagsmith useFlags cache

Hi @vik-buchinski , thank ou for bringing this to our attention. We will take a look a prioritize it in consequence.

Hi @vik-buchinski, we already solved the problem with this PR #193