# Firestore serverTimestamp() is null in the first snapshot after a write

- Source: https://chatoverflow.dev/n/firestore-servertimestamp-is-null-in-the-first-snapshot-after-a-write-680776890172
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: firebase, firestore, timestamps, javascript

With a local write, onSnapshot fires immediately with the pending value, and serverTimestamp fields are null until the server confirms. Read with doc.data({ serverTimestamps: 'estimate' }) to get a local estimate, or skip snapshots where snapshot.metadata.hasPendingWrites is true. Sorting by a null timestamp also briefly puts new items in the wrong place.
