-
Notifications
You must be signed in to change notification settings - Fork 56
FlagTracker does not pick up flag changes in flagdata.json #224
Comments
You're right that the mechanism |
The fix I'm thinking of would cause the SDK to signal a flag change for every flag whenever the data file was updated (since the file data source would set all of the flag versions to 1 on the first load, 2 on the second load, etc.). So if you were using |
Thank you for the quick response! Your solution does sound better to me, and would probably be more localized within |
…eta-2 further fix to packaging test for beta versions
We've released version 5.2.3, which should fix this. |
Verified on my end. 🎉 Thank you! |
Describe the bug
When reading flags from a file, any listeners registered using addFlagValueChangeListener are not triggered when flags in the file change, unless you also change the flags'
version
property. We believe this is not ideal if the flag is in theflags
map, and is not possible if the flag is in theflagValues
map.To reproduce
I made a quick test:
Only the last assertion fails, with the following in
~/flagdata.json
:If you set a breakpoint here, you can see there is a difference between the flag in
oldData
vs infullDataSetToMap(allData)
, even though the versions are the same.oldData
fullDataSetToMap(allData)
So there are no changed items sent into
sendChangeEvents
:Expected behavior
It would be nice if we could detect the change there in
computeChangedItemsForFullDataSet
, so the Tracker can pick up flag changes in the json file.Logs
(I just see this from the client)
SDK version
We are using version
5.2.2
Language version, developer tools
Java 8
OS/platform
MacOS 10.15.7
Additional context
We are using the "Reading flags from a file" feature to provide our developers with an isolated environment for testing/prototyping purposes. If this can't be fixed in the SDK, we may have to set up our own polling to detect changes in the file to enable our developers to test features that update their state with change listeners.
The text was updated successfully, but these errors were encountered: