Orthogonal-Systems / Origin

Monitoring and Alert Server
GNU General Public License v3.0
0 stars 4 forks source link

Logged data is sensitive to Dict ordering #17

Open JuanBohorquez3 opened 3 years ago

JuanBohorquez3 commented 3 years ago

When registering or posting to a stream using the Origin.Server interface, the order of the keys in the register and post dicts matters. In practice this means that is a stream is re-started with a dict in a different order than the original, The data corresponding to one field may be posted as if it corresponds to another.

Messing around with the key_order parameter did not help

mfe5003 commented 3 years ago

Are you mixing json and encoded registrations?

JuanBohorquez3 commented 3 years ago

I think it's all json. I'm using the origin.client.registerStream() function and then in the server connection the send(), they both seem to use json. Not sure what an encoded registration is. I tried using the keyOrder parameter but I couldn't get it to maintain the mapping.

mfe5003 commented 3 years ago

I think this is a server side fix. I think you can just lexicographic sort the key order (for JSON only) in the registrations so it doesn't matter what order it deserialized with (since JSON doesn't preserve order).