beamable / BeamableProduct

The beamable product suite including com.beamable, com.beamable.server, microservice base image, portal, the installer, and build scripts
Other
3 stars 0 forks source link

Boxed value error when trying to use nested Optional via Content Manager #3462

Open allister-beamable opened 1 month ago

allister-beamable commented 1 month ago

Describe the bug

When the class definition for a piece of Beamable Content includes nested objects, especially nested Optional<T> fields, the Unity Editor tooling for editing and displaying content gets messed up.

To Reproduce

Steps to reproduce the behavior:

  1. Have an "inner node" class that has an Optional<string> field.
  2. Have a "middle node" class that has an Optional<MyInnerNode> field.
  3. Try to create and edit a piece of content with a class that nests these classes from steps 1 and 2.
  4. Publish content
  5. Download content and check things out.

Expected behavior

The Beamable Unity SDK serializes and deserializes nested structures consistently in both "upload" and "download" directions.

Actual behavior

Inner fields end up being unexpectedly null. Something about the unity editor display of the content is wrong.

Metadata

cdhanna commented 3 weeks ago

we have lots of existing serialization tests, so we could add some more for this inner optional nested thingy

client/Packages/com.beamable/Tests/Runtime/Beamable/Content/Serialization/ClientContentSerializer/SerializeTests.cs