firebase / firebase/firebase-admin-node

Filter.or over a missing field breaks the whole query silently

Abierto
#2,952 2 comentarios 0 reacciones 1 asignado Reclamado por @dconeybe Ver en GitHub
api: firestore
Lenguaje dominante
TypeScript
Estrellas
1.7k
Forks
419
Merge medio
3 d 10 h
PR fusionados (30 d)
16

Descripción

### [REQUIRED] Step 2: Describe your environment

Live.
It works in the emulator.

### [REQUIRED] Step 3: Describe the problem

#### Steps to reproduce:

If one or more of the filters inside a `Filter.or` queries a non-existent property, then the whole `Filter.or` returns false, returning no results, even if the other filters (e.g. Age in the example below) do match.
No errors or warnings are raised, the query "fails" silently.

#### Relevant Code:

```
let snap = await firestore.collection('MyThing').where(
Filter.or(
Filter.where('age', '>=', 18),
Filter.where('nonExistentProperty', '>=', 123),
)
).get()
```

I get the limitations on querying non-existent fields, but the whole thing shouldn't fail silently.

Either the other filters should still work, or there should be an error raised.

This doesn't occurr on the emulator, so was only a prod issue that it just took me several hours to track down.

At least make the emulator mirror live!

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.