Hi all,
I have investigated this issue today and was able to replicate the issue you are getting with booleans. They are indeed being taken in as objects.
The workaround for this behaviour would be to compare the value using (data.boolValue != true) as seen above. You could also compare the value to true when reading it in if you are expecting a boolean using:
var data = (Spark.getGameDataService().getItem("data", "1").document().getData().boolValue == true);
Apologies for the inconvenience. The issue has been noted and added to our backlog to be investigated.
Regards,
Cillian.
Will GDS have boolean data types supported anytime in the future?
J.B. Lai
Hi,
We've come across a bug when getting an entry from the new GDS service. Evaluating a boolean field in the object directly in a condition statement seems to always evaluate as true even if the field is set to false.
i.e.
Step to reproduce:
1. Create an indexed type with no indexes.
2. Insert { "boolValue" : false } with ID 1
3. Create an event and use the above code in a event
4. Use test harness to debug the event and observe the weird behaviour when stepping over the code.
We create a server where we've already put all the above steps. Let us know if you want the API key to go see it. We could also create a ticket for it if you'd like.
3 people have this problem