-
Notifications
You must be signed in to change notification settings - Fork 492
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
FeedIterator<T>.ReadNextAsync throws NullReferenceException with custom serializer #871
Comments
Can you please provide the full exception message? Query does return empty pages. If you have a custom serializer it should be able to handle this. |
I tracked it down, The FeedIterator wraps the result inside a response with a "Documents" element. The default serializer seems to address it whereas a custom serializer needs to drill into the response |
Here is what the contract should look like.
|
@fuocor I'm closing this issue since you figured out the issue. Please re-open it the issue isn't fixed. |
It makes writing a custom serializer nearly impossible. The type requested from the serializer is |
That's a good point. The test have access to the internals which is why it's not having an issue with this. The only option I see is to make |
Ask for an interface or abstract base class. |
You have similar problems with ChangeFeed Processing.
|
ResponseMessage and ItemResponse are public. It shouldn't have any issue creating an instance of these. |
It's the content of the response that is the problem |
DocumentServiceLeaseCore and LockDocument shouldn't be using the custom serializer. It should be using the property serializer. That's definitely a bug. Fixing that seems like it's going to be interesting. |
FYI: Using cosmos change feed is completely blocked for us until this is fixed. We can't deserialize CosmosFeedResponseUtil. |
Yes, it fixes using a custom serializer with Change Feed, as it will only used for the Delegate changes. |
We should be doing a release later this week or early next week. Just waiting on a few more PRs to get merged first. |
That timeline will work for us. Thanks! |
Describe the bug
FeedIterator.ReadNextAsync throws NullReferenceException with custom serializer.
The stream sent to the serializer is empty. `All the other Cosmos methos serialize fine and
GetItemQueryStreamIterator
works as does the default serializer.To Reproduce
Expected behavior
Deserialized object.
Actual behavior
NullReferenceException
Environment summary
SDK Version: 3.0.100
Cosmos Version: 3.2.0
OS Version: Windows 10
The text was updated successfully, but these errors were encountered: