Context
As part of the timestamp migration (commit 48bb97f, 2026-04-03), all Firestore writes were standardized from Date.now() / new Date() to proper Firestore server timestamps. Read-side TypeScript types were temporarily loosened to any to handle both legacy numeric and new Timestamp values during the transition period.
What needs to happen
- Verify all legacy numeric timestamps have aged out — short-TTL collections (commands, device_codes, mfa_pending, etc.) are already clean. Long-lived collections (
sites, users, webhooks, apiKeys, chats) may still have old numeric values.
- Run a one-time migration script for long-lived collections — read each doc, rewrite any numeric timestamp fields as proper Firestore Timestamps. Should be a few dozen documents at most.
- Tighten types back to
Timestamp in these files:
web/hooks/useDeployments.ts
web/hooks/useProjectDistributions.ts
web/hooks/useFirestore.ts
web/hooks/useScreenshotHistory.ts
web/components/machines/ScreenshotDialog.tsx
- Remove defensive read fallbacks (the
?.toMillis?.() ?? value ?? 0 patterns) once all data is confirmed Timestamp-typed.
Target date
June 2, 2026 — 60 days from migration. By then, all medium-TTL data (deployments, logs, screenshots) will have naturally cycled. Only the long-lived collections need the migration script.
Related
- Timestamp migration commit:
48bb97f
- Data model docs:
docs/reference/firestore-data-model.md
Context
As part of the timestamp migration (commit
48bb97f, 2026-04-03), all Firestore writes were standardized fromDate.now()/new Date()to proper Firestore server timestamps. Read-side TypeScript types were temporarily loosened toanyto handle both legacy numeric and new Timestamp values during the transition period.What needs to happen
sites,users,webhooks,apiKeys,chats) may still have old numeric values.Timestampin these files:web/hooks/useDeployments.tsweb/hooks/useProjectDistributions.tsweb/hooks/useFirestore.tsweb/hooks/useScreenshotHistory.tsweb/components/machines/ScreenshotDialog.tsx?.toMillis?.() ?? value ?? 0patterns) once all data is confirmed Timestamp-typed.Target date
June 2, 2026 — 60 days from migration. By then, all medium-TTL data (deployments, logs, screenshots) will have naturally cycled. Only the long-lived collections need the migration script.
Related
48bb97fdocs/reference/firestore-data-model.md