Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[🐛] Firestore pipelines: Timestamp (and Date) constants are sent as plain maps

Aperta
#9,412 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Mastersam07 ci sta già lavorando.

Dal 30/10/2026.

  • #9416 di @Mastersam07 — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
firebase, javascript, typescript
Ambito
backend, database

Direzione di ricerca

Start with packages/firestore/lib/pipelines/expressions.ts and packages/firestore/lib/pipelines/pipeline_runtime.ts, then trace the pipeline value parsing and node building paths for iOS, Android, and web. Compare the GeoPoint handling added for #9403 and inspect the existing pipeline end-to-end tests. Done means Timestamp and Date constants are reconstructed as SDK values across the listed platforms, comparisons work, and constant(timestamp) returns a Timestamp.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

impact: web-implementation platform: all plugin: firestore type: bug

Issue

A Timestamp passed to a pipeline as a constant is sent to native and to the web SDK as a plain { seconds, nanoseconds } map, not as a timestamp. This is the same class of bug as #9403 fixes for GeoPoint.

const { execute, field, constant } = firestorePipelinesModular;
const { Timestamp } = firestoreModular;

execute(
  db
    .pipeline()
    .collection('events')
    .where(field('startTime').greaterThan(constant(new Timestamp(1700000000, 0)))),
);

On main (c65e1ee3b):

  • JS: constant() keeps class instances as they are (expressions.ts#L698). Then serializeValue turns a Timestamp into { seconds, nanoseconds } with no marker (pipeline_runtime.ts#L265-L266).
  • iOS, Android and web: nothing in the pipeline parsers or node builders reads seconds and nanoseconds back into the SDK's Timestamp. Those fields only appear in the result serializers, for output. So the backend gets a map constant.
  • Tests: the existing pipeline e2e tests that use Timestamps store them with setDoc and read them back as fields. None passes a Timestamp as a pipeline constant.

Expected: comparisons against a Timestamp constant match stored timestamps, and constant(timestamp) reads back as a Timestamp. Today a comparison against a map likely never matches, as with GeoPoint before #9403.

The constant() docs also list Date. A Date looks affected too: it isn't a plain object, so constant() keeps it, and serializeValue then copies its own enumerable fields, of which a Date has none. That leaves an empty map. serializeValue doesn't special-case Bytes or VectorValue either.

Possible fix: tag them the way #9403 tags GeoPoint (__kind: 'timestamp'), and rebuild the SDK value in the iOS, Android and web pipeline value paths.


Project Files

Javascript
Click To Expand

package.json:
# N/A
firebase.json for react-native-firebase v6:
# N/A
iOS
Click To Expand

ios/Podfile:
  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# N/A
AppDelegate.m:
// N/A


Android
Click To Expand

Have you converted to AndroidX?
  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?
android/build.gradle:
// N/A
android/app/build.gradle:
// N/A
android/settings.gradle:
// N/A
MainApplication.java:
// N/A
AndroidManifest.xml:
<!-- N/A -->


Environment

Click To Expand

react-native info output:

 N/A
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • 27.1.0 (main at c65e1ee3b)
  • Firebase module(s) you're using that has the issue:
    • Firestore (pipelines)
  • Are you using TypeScript?
    • N/A

Lingua principale
TypeScript
Stelle
12.3k
Fork
2.3k
Merge medio
1g 16h
PR unite (30g)
23

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di invertase/react-native-firebase

Tutte le issue di invertase/react-native-firebase

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.