graphql-dotnet / graphql-dotnet/graphql-client
subscriptionStream.Subscribe response never occurs (fails silently) if deserialization fails
- Dominant language
- C#
- Stars
- 648
- Forks
- 136
- PR merge metrics
- No merged PRs in 30d
Description
I have a case where I receive subscription messages that among other things contain enum values. Everything is fine if deserialization works, but if it fails (in this case because of #311), neither the exceptionHandler provided to CreateSubscriptionStream nor the IObservable provided to the Subscribe method is ever called. The subscription message is effectively dropped.
I discovered this when investigating why some messages got through and others did not. It turned out that if the enum values all where "Regular" values (and not PascalCase or camelCase - see #311) everything was fine. But for PascalCase, the message failed. Digging deeper, I discovered that the NewtonSoft deserializer does raise an exception informing of the error `Newtonsoft.Json.JsonSerializationException: Error converting value "PASCAL_CASE" to type 'TestEnum'. Path ...`, but that error causes the message to never get to either the exceptionHandler or IObservable callback. I would expect one of the two to be called. Of course if it were the IObservable>, Errors should contain error information.
This issue is about making sure an error is raised when deserialization throws an exception in case any other exceptions, such as the one discussed in #311 also crop up.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.