Unleash / unleash-client-rust

Unleash client SDK for Rust language projects
Apache License 2.0
23 stars 18 forks source link

Log deserialization error on poll. #73

Open mstyura opened 8 months ago

mstyura commented 8 months ago

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

daveleek commented 8 months ago

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

mstyura commented 8 months ago

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

alvinometric commented 2 months ago

@mstyura is this still needed?

mstyura commented 2 months ago

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.