unleash-client-rust icon indicating copy to clipboard operation
unleash-client-rust copied to clipboard

Log deserialization error on poll.

Open mstyura opened this issue 1 year ago • 5 comments

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: Screenshot 2024-01-03 at 23 22 52

Such deserialization is by default is not supported by serde and require additional work like this

mstyura avatar Jan 03 '24 22:01 mstyura

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?)

daveleek avatar Jan 12 '24 13:01 daveleek

Hello! I had answered most of the questions in neighbor MR https://github.com/Unleash/unleash-client-rust/pull/74#issuecomment-1895973920

mstyura avatar Jan 22 '24 20:01 mstyura

@mstyura is this still needed?

alvinometric avatar Jul 05 '24 19:07 alvinometric

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.

mstyura avatar Jul 05 '24 19:07 mstyura

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 )

vanng822 avatar Sep 21 '24 18:09 vanng822