firebase / firebase/firebase-admin-node

onDocumentUpdate event is typed as having data potentially undefined

Ouverte
#2,202 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
1.7k
Forks
419
Merge moyen
3 j 10 h
PR mergées (30 j)
16

Description

It seems weird that an update event could contain nothing, if that's the case an update event did not occur, did it ?

```ts
// firestore.d.ts
export declare function onDocumentUpdated(document: Document, handler: (event: FirestoreEvent | undefined, ParamsOf>) => any | Promise): CloudFunction | undefined, ParamsOf>>;
```

It is annoying because it forces an additional, seemingly unnecessary, check.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start with the firestore.d.ts declaration shown in the issue and inspect the onDocumentUpdated event type. Confirm the intended non-optional event type and verify that the generated declaration no longer requires an unnecessary undefined check.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
firebase, typescript
Domaine
api, backend
Type d'issue
Bug
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.