f-miyu / Plugin.CloudFirestore

MIT License
121 stars 44 forks source link

Crash when there is a DateTime property. #54

Closed 15sawyer closed 1 year ago

15sawyer commented 3 years ago

I get a crash when I try to add an object with a DateTime property to firestore. (JavaException) My minimal failing example is an otherwise empty class, only one DateTime property. The crash doesn't happen when the DateTime is marked as ServerTimestamp.

What is really weird is that I already have a class with multiple DateTime properties. One of them is not marked as ServerTimestamp. But this class works just fine. Only when I try adding a second unmarked DateTime, the crash happens.

Failing class: public class Test { public DateTime DateAndTime { get; set;} }

Used to add to firestore: var reference = firestore.GetCollection("somecollection").CreateDocument(); await firestore.RunTransactionAsync((transaction) => { transaction.SetData(reference, testClass); });