googleapis / googleapis/google-cloud-node
Nested object with all `undefined` fields causes entire nested chain to be omitted
@dconeybe ci sta già lavorando.
Dal 9/8/2023.
- Lingua principale
- TypeScript
- Stelle
- 3.2k
- Fork
- 713
- Merge medio
- 2g 9h
- PR unite (30g)
- 104
Descrizione
Consider an operation like so:
ref.set({
a: {
b: {
c: undefined
}
})
With ignoreUndefinedProperties: true, I would have expected the result written to Firestore to be
{
a: {
b: {}
}
}
However the actual result is that the entire a→b→c nested chain is entirely omitted:
{}
Is this the intended behaviour?
I believe it is due to these lines below, which, when there are no other non-undefined fields in any of the objects, flows all the way up the chain causing the entire nested chain to be omitted.
Essentially those lines mean than an object consisting entirely of undefined fields should be omitted (the object itself), rather than just serialised as an empty object.
Tested on @google-cloud/firestore version: 6.7.0.
Guida per i contributori
Apri 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.
Valutazione
Questa issue non è ancora stata valutata.