updateOnResolve in Chain driver does nothing
AALMA opened this issue · 1 comments
I was looking at using this package and found that the updateOnResolve config option in the config file does nothing. I see there is code in the ChainRepository for handling this feature but it never gets called because the FeatureFlagsServiceProvider register method does not pass the config value through to the ChainRepository on creation.
I tried to enable this feature by modifying the FeatureFlagsServiceProvider to pass the config value and I think I quickly found the reason why this is not enabled. If you use this updateOnResolve feature to update the attempted drivers but then call turnOff or turnOn again the different locations get out of sync.
My question is was this purposely left out and if so is it because of this issue? If so, was there a reason to not just modify the turnOn and turnOff to store the feature state in all levels of the chain if updateOnResolve is enabled?
One solution to this may be to just make the state config option an array instead of a single string so we could tell it to store the values in multiple locations, then updateOnResolve would not really be necessary.
The main reason I'm asking is that I'd like to use the chain driver because I would expect reading from redis would be faster but I'd like to have something a little more permanent like the database driver to fallback on.
@AALMA I've fixed the config issue. Thank you for pointing that out.
Can you give a slightly more detailed scenario of how the repositories get out of sync with the on/off feature. I think I understand the problem but I'd like to have a clear set of steps to build tests around before modifying the Chain repository on what I think is the case.