
The Server Loop
The blog is failing to publish because of a critical database mechanics issue: Firestore strictly excludes documents from queries if the ordered field is null or missing, and requires a composite index when filtering by one field and ordering by another. In your current updatePost logic, if a post is saved without properly stamping the publishedAt timestamp (or if it remains null), Firestore's query orderBy("publishedAt", "desc") will permanently hide it from your live blog list. Furthermore, if the composite index hasn't been built in your Firebase console, the query silently fails and your try/catch block forces the static fallback posts to load instead.
Here is the fully improved, production-ready code. It fixes the timestamp transition bugs, ensures type-safe serialization, and logs precise Firebase index URLs to your console so you can fix database permissions instantly. Go
Questions about your own setup?
Talk to a deliverability engineer about your sending volume and timeline.


