-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server Timestamps #272
Comments
@louisameline Sorry it took a while to get back to this issue.... Originally I was using serverTimestamp for The reasoning was explained in the release notes of version 1.26. In a nutshell the reason was because Firebase onSnapshot listener executes a This means that the front-end app would refresh the entire object with the object from the server again once after each single change (because of One example of such a case was in my own app, where a toggle switch had its state saved as This was the main problem of serverTimestamps so I opted for not using them at all. For version two this is one of the things that will require careful architecture because of optimistic UI, and I haven't figured out the best way yet. However, I do think that in version 2 I will include a default |
I understand your reasons. |
Hello, I see no trace of
Firebase.firestore.FieldValue.serverTimestamp()
in the code and it seems that the library generates its ownupdated_at
etc. withDate()
, am I missing something?If that is actually the case, it's too easy for the user to change the date on his device and cheat the system. Although of course the real security is using a Firebase function server-side for those who want to go that far.
Also, I could pass a
Firebase.firestore.FieldValue.serverTimestamp()
myself as a value of a property, but I'd rather expect to pass something like%serverTimestamp%
, it would synchronously use the user's device time to fill the state, but asynchronously get the real timestamp back from the server (and update the state with this real value). Besides, I don't feel comfortable using Firestore objects myself, one of the points for me in v-e-f is to have an abstraction of Firestore.Thank you!
The text was updated successfully, but these errors were encountered: