go-feature-flag icon indicating copy to clipboard operation
go-feature-flag copied to clipboard

feat: Add initial delay for polling feature configuration

Open samuolis opened this issue 1 year ago • 4 comments

Description

  • Added pollingDelayInMillis in initialize options, to declare delay for the first request of feature flags
  • Added tests to cover this case

This should solve the issue of getting feature flags before the first polling even happened (Default delay is 5 mins, it is okay for polling but not okay for waiting for initial data)

Checklist

  • [x] I have tested this code
  • [x] I have added unit test to cover this code
  • [x] I have updated the documentation (README.md and /website/docs)
  • [x] I have followed the contributing guide

samuolis avatar Aug 23 '24 10:08 samuolis

Deploy Preview for go-feature-flag-doc-preview canceled.

Name Link
Latest commit e7202d3311c149f8e4c62131752d89b9bc8f279c
Latest deploy log https://app.netlify.com/sites/go-feature-flag-doc-preview/deploys/66d6b83c86ba260008f03ea0

netlify[bot] avatar Aug 23 '24 10:08 netlify[bot]

@thomaspoignant Do this library need code duplication check on tests, because it is falling on already existing tests?

Edit: Changed sonar config to include those files, there was typo

samuolis avatar Aug 23 '24 10:08 samuolis

@samuolis thanks for your pull request, it fixes an important problem from the provider.

I am currently away (taking some vacation), but I will look closely to your PR early September and we will be able to release a new version of the provider with this addition.

For the code duplication, this should not be a problem for test, thanks for the sonar fix 🙏

thomaspoignant avatar Aug 24 '24 07:08 thomaspoignant

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.02%. Comparing base (eec11f3) to head (e7202d3). Report is 58 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2257   +/-   ##
=======================================
  Coverage   86.02%   86.02%           
=======================================
  Files         102      102           
  Lines        3743     3743           
=======================================
  Hits         3220     3220           
  Misses        399      399           
  Partials      124      124           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 29 '24 09:08 codecov[bot]

Sorry for such a delay, I missed this line somehow. I now see what was the problem, somehow the first API call was getting cancelled, now it works perfectly

samuolis avatar Sep 18 '24 08:09 samuolis