As described in this dotnet runtime issue, some environments encounter a peculiarity with explicit interface method implementations involving covariant generics:
This manifests as several derived types, most notably the one used for chat messages, inappropriately invoking the serialization logic for the abstract base type rather than the intended derived type -- meaning we don't serialize the important content value and send invalid requests.
Pending runtime resolution, this change aligns this library's impacted request types with a better practice of managing serialization in an overrideable WriteCore(); this means that, even with the covariant oddity invoking the wrong instantiation of the explicit interface, we'll use the correct serialization logic from the downcast type.
As reported:
As described in this dotnet runtime issue, some environments encounter a peculiarity with explicit interface method implementations involving covariant generics:
https://github.com/dotnet/runtime/issues/103365
This manifests as several derived types, most notably the one used for chat messages, inappropriately invoking the serialization logic for the abstract base type rather than the intended derived type -- meaning we don't serialize the important
content
value and send invalid requests.Pending runtime resolution, this change aligns this library's impacted request types with a better practice of managing serialization in an overrideable
WriteCore()
; this means that, even with the covariant oddity invoking the wrong instantiation of the explicit interface, we'll use the correct serialization logic from the downcast type.