-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix for covariant search date parsing #2643
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
Conversation
This commit fixes an issue where indexing dates as strings and pulling them back out using covariant search would result in the format being different due to the default DateParseHandling serialization settings. ConcereteTypeConverter now temporarily sets DateParseHandling to None when deserializing covariant results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nag but other than that LGTM
@@ -94,7 +94,10 @@ internal static class ConcreteTypeConverter | |||
|
|||
private static JObject CreateIntermediateJObject(JsonReader reader) | |||
{ | |||
var original = reader.DateParseHandling; | |||
reader.DateParseHandling = DateParseHandling.None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment why we feel this is not side effecty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great fix. ++ on adding a comment.
Quick question, where do we use the StatefulDeserialization class? Only for Covariant Search type? Just trying to understand whether this can affect other functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CovariantSearch needs ConcreteTypeConverter, in order to create an isolated serializer that has access to state we call the Stateful deserialization factory on ISerializerFactory
and we append a new instance of ConcreteTypeConverter. Search/MultiGet/MultiSearch/SearchTemplate all possibly call this (but only if needed)
* Fix for covariant search date parsing This commit fixes an issue where indexing dates as strings and pulling them back out using covariant search would result in the format being different due to the default DateParseHandling serialization settings. ConcereteTypeConverter now temporarily sets DateParseHandling to None when deserializing covariant results. * add comment explaining the fix
* Fix for covariant search date parsing This commit fixes an issue where indexing dates as strings and pulling them back out using covariant search would result in the format being different due to the default DateParseHandling serialization settings. ConcereteTypeConverter now temporarily sets DateParseHandling to None when deserializing covariant results. * add comment explaining the fix
Merged to 2.x, 5.x, and master |
* Fix for covariant search date parsing This commit fixes an issue where indexing dates as strings and pulling them back out using covariant search would result in the format being different due to the default DateParseHandling serialization settings. ConcereteTypeConverter now temporarily sets DateParseHandling to None when deserializing covariant results. * add comment explaining the fix
This commit fixes an issue where indexing dates as strings and pulling
them back out using covariant search would result in the format being
different due to the default DateParseHandling serialization settings.
ConcereteTypeConverter now temporarily sets DateParseHandling to None
when deserializing covariant results.
/cc @gmoskovicz