From a17740e9146e4e2431d62964d044287cccc3ee85 Mon Sep 17 00:00:00 2001 From: Konstantin Varlamov Date: Fri, 30 Mar 2018 14:50:15 -0400 Subject: Add a flag to control whether DocumentSnapshots return Dates or Timestamps for timestamp fields (#831) * add a new property `timestampsInSnapshotsEnabled` to `FirestoreSettings`, `false` by default; * add a verbose warning message urging users to opt into the new behavior; * set `timestampsInSnapshotsEnabled` to true in the integration tests to reduce the verbose console spam during the test run and make sure the flag won't break anything once it's flipped. --- Firestore/CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Firestore/CHANGELOG.md') diff --git a/Firestore/CHANGELOG.md b/Firestore/CHANGELOG.md index c0fa621..a0493d7 100644 --- a/Firestore/CHANGELOG.md +++ b/Firestore/CHANGELOG.md @@ -2,6 +2,16 @@ - [fixed] Fixed a regression in the Firebase iOS SDK release 4.11.0 that could cause `getDocument()` requests made while offline to be delayed by up to 10 seconds (rather than returning from cache immediately). +- [feature] Added a new `Timestamp` class to represent timestamp fields, + currently supporting up to microsecond precision. It can be passed to API + methods anywhere a system Date is currently accepted. To make + `DocumentSnapshot`s read timestamp fields back as `Timestamp`s instead of + Dates, you can set the newly added property `areTimestampsInSnapshotsEnabled` + in `FirestoreSettings` to `true`. Note that the current behavior + (`DocumentSnapshot`s returning system Dates) will be removed in a future + release. Using `Timestamp`s avoids rounding errors (system Date is stored as + a floating-point value, so the value read back from a `DocumentSnapshot` + might be slightly different from the value written). # v0.10.4 - [changed] If the SDK's attempt to connect to the Cloud Firestore backend -- cgit v1.2.3