An error message shows in the FIrebase Cloud Functions Logs when modifying a Firestore doc with a timestamp.
@firebase/firestore: Firestore (5.8.0):
The timestampsInSnapshots setting now defaults to true and you no
longer need to explicitly set it. In a future release, the setting
will be removed entirely and so it is recommended that you remove it
from your firestore.settings() call now.
timestampsInSnapshots from your codebase.The behavior for Date objects stored in Firestore is going to change
AND YOUR APP MAY BREAK.
To hide this warning and ensure your app does not break, you need to add the
following code to your app before calling any other Cloud Firestore methods:
const firestore = new Firestore();
const settings = {/* your settings... */ timestampsInSnapshots: true};
firestore.settings(settings);
With this change, timestamps stored in Cloud Firestore will be read back as
Firebase Timestamp objects instead of as system Date objects. So you will also
need to update code expecting a Date to instead expect a Timestamp. For example:
// Old:
const date = snapshot.get('created_at');
// New:
const timestamp = snapshot.get('created_at');
const date = timestamp.toDate();
Please audit all existing usages of Date when you enable the new behavior. In a
future release, the behavior will change to the new behavior, so if you do not
follow these steps, YOUR APP MAY BREAK.
Originally posted here: https://github.com/firebase/firebase-js-sdk/issues/1498
I found a few problems with this issue:
This is what I would expect to see at this stage. @firebase/firestore (the JS SDK) has already stopped supporting timestampsInSnapshots option. But firebase-admin (the Admin SDK) still does. These 2 libs should not be mixed in general -- especially in a server-side environment such as Cloud Functions.
firebase-admin will also drop support for this setting in an upcoming release.
how should i fix this??
[2019-02-11T09:52:26.403Z] @firebase/firestore: Firestore (5.8.1):
The timestampsInSnapshots setting now defaults to true and you no
longer need to explicitly set it. In a future release, the setting
will be removed entirely and so it is recommended that you remove it
from your firestore.settings() call now
@surajgupta57, it is a pretty descriptive error. Just do what it says. Somewhere in your code you have firestore.settings({ timestampsInSnapshots: true });. That needs to be removed.
i hadn't written this things..
On Mon, Feb 11, 2019 at 7:18 PM Mike McLin notifications@github.com wrote:
@surajgupta57 https://github.com/surajgupta57, it is a pretty
descriptive error. Just do what it says. Somewhere in your code you have firestore.settings({
timestampsInSnapshots: true });. That needs to be removed.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/firebase/firebase-admin-node/issues/449#issuecomment-462332852,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ah5wuvUpg73ea4gEDic0vo7vsUximvmFks5vMXSWgaJpZM4aTpTy
.
Please see this issue https://github.com/angular/angularfire2/issues/1993
comment of the @SnisarOnline solved my problem
@firebase/firestore: Firestore (5.8.1):
The timestampsInSnapshots setting now defaults to true and you no
longer need to explicitly set it. In a future release, the setting
will be removed entirely and so it is recommended that you remove it
from your firestore.settings() call now.
facing this issue
can u resolve my issue i can provide u my code
send me your code
On Thu, Feb 14, 2019 at 5:14 PM Muhmmad Tahir notifications@github.com
wrote:
@firebase/firestore: Firestore (5.8.1):
The timestampsInSnapshots setting now defaults to true and you no
longer need to explicitly set it. In a future release, the setting
will be removed entirely and so it is recommended that you remove it
from your firestore.settings() call now.
facing this issue
can u resolve my issue i can provide u my code—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/firebase/firebase-admin-node/issues/449#issuecomment-463597760,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ah5wutP5GpeqDjOZ1bLwhbST2rZp8n-Oks5vNUwdgaJpZM4aTpTy
.
https://github.com/MuhammadTahir7/AngularCrud
here is the code @surajgupta57
firestore.settings({ timestampsInSnapshots: true }); use this to solve your prob
In react native. Would commend out the line where the issue was and then another error showed up. Something at the core is wrong.
Most helpful comment
i hadn't written this things..
On Mon, Feb 11, 2019 at 7:18 PM Mike McLin notifications@github.com wrote: