We use Remote Config 1.0.9 and I’ve upgraded to 1.2.3 so that I can specify a non-default environment, because we make builds for internal review without the Development flag set, whereas I want to use the Development environment.
However, I’ve noticed that settings that contain date strings such as “2020-06-12T00:00:00Z” are now coming through as “06/12/2020 00:00:00”, whereas previously they would have come through transparently.
I don’t think this is a documented change.
Do you have any suggestions on how to parse these strings? I’m based in the UK, but it looks like a mm/dd/yyyy format is being used, so I’m wary of assuming that the locally set culture is being used in the conversion.
Can you share the code that you are using and a screenshot of your settings? We will take a look.
The code is
string dateTimeString = RemoteConfigHandler.GetString("StartDate", DateTime.Today.ToString("yyyy-MM-dd\\THH:mm:ss\\Z"))
where RemoteConfigHandler.GetString is defined as
internal static string GetString(string key, string defaultValue = "")
{
return ConfigManager.appConfig.GetString(key, defaultValue);
}
Yes, I am seeing the same thing. I will let the team know. You can also view the issue in the Remote Config editor by doing a Push of the string value followed by a Pull
1 Like
Thanks.
I’ve been using the web dashboard exclusively as the editor is often blank for me - see screenshot.
Please compare to a new/empty project with RC enabled and start a new thread for this separate issue, thanks.
Hi @dri_richard ,
Thanks for finding this bug!
The reason for this strange behavior is that we used Json.Net library after 1.0.9, which converts any string in date format, interpreting strings as dates by default. That surprised us as well, and we fixed this for the Date field but forgot to assume that someone could use settings of type string as dates (which is your case).
This very issue inflamed some discussions for otherwise excellent Json.Net library (Json.NET interprets and modifies ISO dates when deserializing to JObject · Issue #862 · JamesNK/Newtonsoft.Json · GitHub) as it was unexpected behavior for many other Json.net connoisseurs.
We will add this fix ASAP, both in 1.2.x and 1.3.x versions of the package.
1 Like
Hi @dri_richard ,
Thanks again for finding this bug!
We applied fix in 1.3.2-preview.9 and 1.2.4-preview.3 versions of the RC package.
Let us know if it works for you.
Hi
Dates are fine, but we have some JSON stored as string values, and double quotes are now being replaced with backslahes, leaving it malformed.
Hi @dri_richard ,
Thanks for the feedback, and sorry for this unfortunate regression, we will fix that scenario as well in the next release,
so string values will be able to have quotes and dates will stay unchanged.
On the side note, in package versions 1.3.x we added JSON as a new setting type, so it became first-class citizen having validation window as well.
By all means, we will let you as soon as this is fixed as you are using 1.2.x
Thanks and sorry for the inconvenience,
Vlatko
Hi @dri_richard
Fix is deployed, so please try to use either 1.3.2-preview.10 and 1.2.4-preview.4
Now you should be able to use double quotes in string fields and no date will be re-formatted.
Thanks again for your cooperation on this issue.
Vlatko