-
-
Notifications
You must be signed in to change notification settings - Fork 15
Description
When i am running the Salesforce subscriber, sometime i receive below log in outbound meta message { "channel": "/meta/handshake", "supportedConnectionTypes": { "$type": "System.Collections.ObjectModel.ReadOnlyCollection1[[System.String, System.Private.CoreLib]], System.Private.CoreLib", "$values": [ "long-polling" ] }, "version": "1.0", "id": "1" }
instead of {"channel":"/meta/handshake","supportedConnectionTypes":["long-polling"],"version":"1.0","id":"1"}
Why this is happening? whenever i have a message with $type my handshake fails.
It's mostly because of code in src/CometD.NetCore/Common/DictionaryMessage.cs class and code is :
var dictionaryList = JsonConvert.DeserializeObject<IList<IDictionary<string, object>>>(content);
We are not specifying the default settings of JSON convert
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
{
Formatting = Formatting.Indented,
TypeNameHandling = TypeNameHandling.None, //Prevents $type issue
ContractResolver = new CamelCasePropertyNamesContractResolver(),
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
};