rojo-rbx / rbx-dom

Roblox DOM and (de)serialization implementation in Rust
MIT License
113 stars 45 forks source link

`WriteUnknown` behavior in rbx_xml does not respect serialization of known properties #419

Open Dekkonot opened 3 months ago

Dekkonot commented 3 months ago

When serializing using rbx_xml, one of the options is to set it to WriteUnknown properties. However, when this behavior is set, it makes properties that should not serialize start serializing if they're present on an Instance. This is most notable with UniqueId since it's automatically added by rbx_dom_weak but it could happen with other properties too.

I've tracked the behavior to this snippet: https://github.com/rojo-rbx/rbx-dom/blob/master/rbx_xml/src/core.rs#87

This causes a property that doesn't serialize to appear as though it's unknown to the serializer. This feels unintuitive and we should probably fix it.