[🐛] Firestore pipelines: Timestamp (and Date) constants are sent as plain maps
I maintainer di solito rispondono entro 1 giorno
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
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
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). ThenserializeValueturns aTimestampinto{ seconds, nanoseconds }with no marker (pipeline_runtime.ts#L265-L266). - iOS, Android and web: nothing in the pipeline parsers or node builders reads
secondsandnanosecondsback into the SDK'sTimestamp. 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
setDocand 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.settingsjetifier=truefor Android compatibility? - I am using the NPM package
jetifierfor 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-firebaseversion you're using that has this issue:27.1.0(mainatc65e1ee3b)
Firebasemodule(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
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di invertase/react-native-firebase
-
Needs Attention type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
invertase/react-native-firebase#9414 ·
I maintainer di solito rispondono entro 1 giorno
-
platform: android type: enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
invertase/react-native-firebase#9399 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[🐛] Firestore pipelines: Bytes and VectorValue constants are sent as their private fieldsForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaimpact: web-implementation platform: all plugin: firestore type: bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
invertase/react-native-firebase#9413 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
invertase/react-native-firebase#9408 ·
I maintainer di solito rispondono entro 1 giorno
-
platform: ios plugin: messaging type: bug
Difficoltà 4/5 1-2 giorni Idoneità per principianti 54/100
invertase/react-native-firebase#9407 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di invertase/react-native-firebase
Issue simili
-
bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
PhyberApex/kuroshiro#1687 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
microsoft/monaco-editor#5563 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
awslabs/visual-asset-management-system#937 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100