beamable / BeamableProduct

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

Error when reading Announcements with rewards in C#MS code #3359

Open allister-beamable opened 3 months ago

allister-beamable commented 3 months ago

Describe the bug

Reported by a customer: await Services.Announcements.GetCurrent(); in C#MS code throws a Newtonsoft.Json.JsonSerializationException saying Error converting value "Rewards" to type 'Beamable.Common.Content.OptionalString'. Path 'announcements[2].gift.description'

Similar code works fine in Unity client code, and players are able to claim rewards from Announcements, but things blow up when C#MS code tries to read Announcements with rewards.

To Reproduce Steps to reproduce the behavior:

  1. Create an Announcement with rewards on it somehow (could be Content, could be a Messaging Campaign)
  2. Write a ClientCallable that uses Services.Announcements.GetCurrent();
  3. Invoke the ClientCallable

Expected behavior

Announcements.GetCurrent() returns a list of announcement data objects, some of which contain reward descriptions.

Actual behavior

An exception is thrown from somewhere inside GetCurrent()

Metadata

cdhanna commented 3 months ago

btw- you can also create an announcement via content.

cdhanna commented 3 months ago

does sending any DTO with an OptionalString work?

cdhanna commented 3 months ago

the hint is to look at UnitySerializationSettings

cdhanna commented 2 months ago

Interesting- this is already fixed on the CLI 2.0 / SAM release. But I verified this is broken on 1.19.15