unleash-client-rust
unleash-client-rust copied to clipboard
Log deserialization error on poll.
About the changes
I was debugging some strange feature polling errors in log which occurred to be JSON deserialization error, but it was not clear until I logged error message.
Important files
Discussion points
Should there be some tolerance to deserialization errors? It is occurred that the problem I've got is some deeply nested object declared "variant" in once case to be a string storing number in JSON like:
...{"name":"xxx","weight":"0","payload":{"type":"string","value":"2"}...
Which is occurred to be not a problem to Java's SDK which rely on GSON:
Such deserialization is by default is not supported by serde and require additional work like this
Hello @mstyura and thank you for your contributions. We'd like to know more about your setup/Unleash instance before we release this. As far as we can tell, Unleash' type system should be sending a proper JSON number. Which version of Unleash are you using, is it self hosted? Does it go through a proxy? (Are you using unleash-proxy?)
Hello! I had answered most of the questions in neighbor MR https://github.com/Unleash/unleash-client-rust/pull/74#issuecomment-1895973920
@mstyura is this still needed?
In general to debug possible future problems like the one I had previously, I think logging error message will dramatically simplify debugging experience of library users.
Yes please. I just try out this lib and get an error from unleash server but couldn't see why. I had to get into the code, edited those lines and recompiled/rebuilt to see the error.
Still not learn how to debug yet (Visual Studio Code didn't want it yet :-D )