I started to mess around with PubSub and I ran into an issue. I’m testing the whisper event and everything is going smoothly until I go to deserialize the data
field. Everything deserializes fine up to the child data
field inside of the parent data
field. It appears that the data
field of the message
field is not formatted properly. At a glance, it looks like it is missing a closing bracket.
Here is is the full message
filed attempting to be deserialized:
"{\"type\":\"whisper_received\",\"data\":\"{\\\"message_id\\\":\\\"dbe13db7-923d-4f31-adcb-06aa7b0ca446\\\",\\\"id\\\":511,\\\"thread_id\\\":\\\"45947671_51012150\\\",\\\"body\\\":\\\"test whisper\\\",\\\"sent_ts\\\":1490311704,\\\"from_id\\\":51012150,\\\"tags\\\":{\\\"login\\\":\\\"rokubotto\\\",\\\"display_name\\\":\\\"RokuBotto\\\",\\\"color\\\":\\\"#00FF7F\\\",\\\"user_type\\\":\\\"\\\",\\\"turbo\\\":false,\\\"emotes\\\":[],\\\"badges\\\":[]},\\\"recipient\\\":{\\\"id\\\":45947671,\\\"username\\\":\\\"sixdegreesofgaming\\\",\\\"display_name\\\":\\\"SixDegreesOfGaming\\\",\\\"color\\\":\\\"#FF0000\\\",\\\"user_type\\\":\\\"\\\",\\\"turbo\\\":true,\\\"badges\\\":[{\\\"id\\\":\\\"premium\\\",\\\"version\\\":\\\"1\\\"}],\\\"profile_image\\\":null},\\\"nonce\\\":\\\"wL78GRCydKkHkQwRplRmYgQvT4rVOH\\\"}\",\"data_object\":{\"message_id\":\"dbe13db7-923d-4f31-adcb-06aa7b0ca446\",\"id\":511,\"thread_id\":\"45947671_51012150\",\"body\":\"test whisper\",\"sent_ts\":1490311704,\"from_id\":51012150,\"tags\":{\"login\":\"rokubotto\",\"display_name\":\"RokuBotto\",\"color\":\"#00FF7F\",\"user_type\":\"\",\"turbo\":false,\"emotes\":[],\"badges\":[]},\"recipient\":{\"id\":45947671,\"username\":\"sixdegreesofgaming\",\"display_name\":\"SixDegreesOfGaming\",\"color\":\"#FF0000\",\"user_type\":\"\",\"turbo\":true,\"badges\":[{\"id\":\"premium\",\"version\":\"1\"}],\"profile_image\":null},\"nonce\":\"wL78GRCydKkHkQwRplRmYgQvT4rVOH\"}}"
And here’s what it looks like when the watch window in VS tries to parse through the string: