-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AppConfig "empty" response handling #1672
Comments
Thank you @chrisclayson for submitting this. And you're more than welcome to create a PR. @scottgerring, can you have a look? |
I'll have to fork to submit PR, so I'll give that a go. One thing I forgot to mention is, initially, this manifest itself with this error here ... I haven't fully worked out why, but we use a transformer, and I don't think it was handling the empty (or I'll raise as a separate bug if I think it one for you to worry about ... it may have been my ropey transformer code. |
Wondering if there is any plans to either fix the issue or merge my PR in (I note it failed a bunch of checks, which I'm assuming because from a fork)? I have a use case for this and, whilst I can supply my own provider with the fix, I'd rather use a supported "out of the box" version ;-) |
@jeromevdl @chrisclayson |
Afternoon, I see this has been tagged for the next release ... just wondering if there is a timeline for the release? |
What were you trying to accomplish?
Using the
AppConfigProvider
for the parameters project, I noticed a bug in the handling of instances where AppConfig returns the empty response (i.e. where config has not changed).This was specifically for a "Freeform configuration profile" rather than feature flags (which I have not tested).
Expected Behavior
The provider should re-use the cached config.
Current Behavior
The provider returns an empty string for the config rather than the cached config. The seems to be because the provider only checks for
null
and not "empty".Possible Solution
I implemented a copy of the
AppConfigProvider
class and added a check forresponse.configuration().asByteArray().length > 0
and this worked, i.e.:I'm happy to submit as a PR.
Steps to Reproduce (for bugs)
{ "version": 1 }
)The first retrieval, on any given runtime environment, will work fine, but after the 30 second TTL the next retrieve from AppConfg returns an empty string, which is returned from the
get()
method rather than original (cached value).Environment
The text was updated successfully, but these errors were encountered: